Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.73 KB | None | 0 0
  1. <?php
  2. /**
  3. * Home services template
  4. *
  5. * @package WPCasa London
  6. */
  7. $display = get_post_meta( get_the_id(), '_services_display', true );
  8. $display_features = get_post_meta( get_the_id(), '_services_display_features', true );
  9.  
  10. if( $display ) : ?>
  11.  
  12. <?php $services = get_post_meta( get_the_id(), '_services', true ); ?>
  13.  
  14. <?php if( $services ) : ?>
  15.  
  16. <div id="home-services" class="site-section site-section-dark home-section<?php if( $display_features ) echo ' home-section-features'; ?>">
  17.  
  18. <div class="container">
  19.  
  20. <div class="wpsight-services">
  21.  
  22. <?php
  23. $args = array(
  24. 'title' => get_post_meta( get_the_id(), '_services_title', true ),
  25. 'description' => get_post_meta( get_the_id(), '_services_description', true ),
  26. 'align' => 'center',
  27. );
  28.  
  29. wpsight_london_section_title( $args );
  30. ?>
  31.  
  32. <div class="row gutter-60">
  33.  
  34. <?php
  35. // Set column class depending on count
  36.  
  37. $count = count( $services );
  38.  
  39. $class = 'col-md-4';
  40.  
  41. if( 1 == $count )
  42. $class = 'col-md-12';
  43.  
  44. if( 2 == $count )
  45. $class = 'col-md-6';
  46.  
  47. ?>
  48.  
  49. <?php foreach( $services as $key => $service ) : ?>
  50.  
  51. <div class="<?php echo $class; ?>">
  52.  
  53. <?php
  54. $url = isset( $service['_service_url'] ) && ! empty( $service['_service_url'] ) ? $service['_service_url'] : false;
  55. $icon = isset( $service['_service_icon'] ) && ! empty( $service['_service_icon'] ) ? $service['_service_icon'] : false;
  56. $label = isset( $service['_service_label'] ) && ! empty( $service['_service_label'] ) ? $service['_service_label'] : false;
  57. $desc = isset( $service['_service_desc'] ) && ! empty( $service['_service_desc'] ) ? $service['_service_desc'] : false;
  58. $button = isset( $service['_service_button'] ) && ! empty( $service['_service_button'] ) ? $service['_service_button'] : false;
  59. $target = isset( $service['_service_target'] ) && ! empty( $service['_service_target'] ) ? $service['_service_target'] : false;
  60.  
  61. // Set up cta arguments
  62.  
  63. $args = array(
  64. 'title' => $label,
  65. 'icon_class' => $icon,
  66. 'description' => $desc,
  67. 'link_text' => $button,
  68. 'link_url' => $url,
  69. 'link_blank' => $target,
  70. );
  71.  
  72. if( $display_features ) {
  73. wpsight_london_feature_box( $args );
  74. } else {
  75. wpsight_london_service( $args );
  76. } ?>
  77.  
  78. </div>
  79.  
  80. <?php endforeach; ?>
  81.  
  82. </div><!-- .row -->
  83.  
  84. </div><!-- .wpsight-services -->
  85.  
  86. </div><!-- .container -->
  87.  
  88. </div><!-- #home-services -->
  89.  
  90. <?php endif; ?>
  91.  
  92. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement