sdobwm

Untitled

Oct 19th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.88 KB | None | 0 0
  1. <?php
  2. // Template Name: Service Template
  3. /**
  4. * @Theme Name : wallstreet-Pro
  5. * @file : service-template.php
  6. * @package : wallstreet-Pro
  7. @author : webriti
  8. * @filesource : wp-content/themes/wallstreet/service-template.php
  9. */
  10. get_header();
  11. get_template_part('index', 'banner');
  12. $wallstreet_pro_options=theme_data_setup();
  13. $current_options = wp_parse_args( get_option( 'wallstreet_pro_options', array() ), $wallstreet_pro_options ); ?>
  14. <!-- Service Section -->
  15. <div class="container">
  16. <div class="row">
  17. <div class="section_heading_title">
  18. <?php if($current_options['service_title'] !='') ?>
  19. <h1><?php echo $current_options['service_title']; ?></h1>
  20. <div class="pagetitle-separator">
  21. <div class="pagetitle-separator-border">
  22. <div class="pagetitle-separator-box"></div>
  23. </div>
  24. </div>
  25. <?php if($current_options['service_description'] !='') ?>
  26. <p><?php echo $current_options['service_description']; ?></p>
  27. </div>
  28. </div>
  29. <div class="row">
  30. <?php
  31. $count_posts = wp_count_posts( 'wallstreet_service')->publish;
  32. if($count_posts > 3)
  33. {$count_posts = 3;}
  34. $arg = array( 'post_type' => 'wallstreet_service','posts_per_page' =>$count_posts , 'offset' => '3' );
  35. $service = new WP_Query( $arg );
  36. if($service->have_posts())
  37. {
  38. while ( $service->have_posts() ) { $service->the_post();
  39. $service_icon_image =sanitize_text_field( get_post_meta( get_the_ID(), 'service_icon_image', true ));
  40. $service_icon_target =sanitize_text_field( get_post_meta( get_the_ID(), 'service_icon_target', true ));
  41. $meta_service_link =sanitize_text_field( get_post_meta( get_the_ID(), 'meta_service_link', true ));
  42. $meta_service_target =sanitize_text_field( get_post_meta( get_the_ID(), 'meta_service_target', true ));
  43. $service_description_text =sanitize_text_field( get_post_meta( get_the_ID(), 'service_description_text', true ));
  44. $service_readmore_text =sanitize_text_field( get_post_meta( get_the_ID(), 'service_readmore_text', true ));
  45. ?>
  46. <div class="col-md-4 col-sm-6 service-effect">
  47. <?php
  48. if(get_post_meta( get_the_ID(),'meta_service_link', true ))
  49. { $meta_service_link= $meta_service_link ; }
  50. else
  51. { $meta_service_link = get_the_permalink(); }
  52. ?>
  53. <?php if(($service_icon_target) && ($service_icon_image)){ ?>
  54. <div class="other-service-area1">
  55. <a href="<?php echo $meta_service_link; ?>" <?php if(get_post_meta( get_the_ID(),'meta_service_target', true )) { echo 'target="_blank"'; } ?>>
  56. <i class="fa <?php if($service_icon_image) { echo $service_icon_image; } ?>"></i>
  57. </a>
  58. </div>
  59. <?php } else {
  60. $defalt_arg =array('class' => "img-responsive");
  61. if(has_post_thumbnail()){ ?>
  62. <div class="service-box">
  63. <a href="<?php echo $meta_service_link; ?>" <?php if(get_post_meta( get_the_ID(),'meta_service_target', true )) { echo 'target="_blank"'; } ?>>
  64. <?php the_post_thumbnail('', $defalt_arg); ?>
  65. </a>
  66. </div>
  67. <?php } else { ?>
  68. <div class="other-service-area1">
  69. <a href="<?php echo $meta_service_link; ?>" <?php if(get_post_meta( get_the_ID(),'meta_service_target', true )) { echo 'target="_blank"'; } ?>>
  70. <i class="fa" style="font-size:24px;"><?php _e('Icon','wallstreet'); ?></i>
  71. </a>
  72. </div>
  73. <?php }
  74. } ?>
  75. <div class="service-area">
  76. <h2><a href="<?php echo $meta_service_link; ?>" <?php if($meta_service_target) { echo 'target="_blank"'; } ?> ><?php the_title(); ?></a></h2>
  77. <p><?php if($service_description_text){ echo $service_description_text; } ?></p>
  78. <?php if($service_readmore_text){ ?>
  79. <div class="service-btn"><a href="<?php echo $meta_service_link; ?>"> <?php echo $service_readmore_text; ?> </a></div>
  80. <?php } ?>
  81. </div>
  82. </div>
  83. <?php } } else {
  84. $service_title = array('', __('Product designing','wallstreet'), __('WordPress themes','wallstreet'), __('Responsive Design','wallstreet'));
  85. for($i=1 ; $i<=3 ; $i++)
  86. { ?>
  87. <div class="col-md-4 col-sm-6 service-effect">
  88. <div class="service-box">
  89. <img class="img-responsive" src="<?php echo WEBRITI_TEMPLATE_DIR_URI ?>/images/service<?php echo $i; ?>.jpg">
  90. </div>
  91. <div class="service-area">
  92. <h2><a href="#"><?php echo $service_title[$i]; ?></a></h2>
  93. <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.Lorem ipsum dolor sit amet, consectetur adipisicing elit dignissim dapib tumst dign eger porta nisl.</p>
  94. <div class="service-btn"><a href="#"><?php _e('Read More', 'wallstreet'); ?></a></div>
  95. </div>
  96. </div>
  97. <?php } } ?>
  98. </div>
  99. </div>
  100. <!-- /Service Section -->
  101.  
  102. <!-- Our Other Service Section -->
  103. <div class="container">
  104. <?php get_template_part('index', 'calloutarea'); ?>
  105.  
  106. <?php if($current_options['other_service_section_enabled']==true) { ?>
  107. <?php
  108. $count_posts = wp_count_posts( 'wallstreet_service')->publish;
  109. if( $count_posts >= 4 || $count_posts == 0)
  110. {
  111. ?>
  112. <div class="row">
  113. <div class="section_heading_title">
  114. <?php if($current_options['other_service_title'] !='') ?>
  115. <h1><?php echo $current_options['other_service_title']; ?></h1>
  116. <div class="pagetitle-separator">
  117. <div class="pagetitle-separator-border">
  118. <div class="pagetitle-separator-box"></div>
  119. </div>
  120. </div>
  121. <?php if($current_options['other_service_description'] !='') ?>
  122. <p><?php echo $current_options['other_service_description']; ?></p>
  123. </div>
  124. </div>
  125. <?php } ?>
  126. <div class="row">
  127. <?php
  128. $j=1;
  129. $count_posts = wp_count_posts( 'wallstreet_service')->publish;
  130. $arg = array( 'offset' => '6', 'post_type' => 'wallstreet_service','posts_per_page' =>$count_posts );
  131. $service = new WP_Query( $arg );
  132. if($service->have_posts())
  133. {
  134. while ( $service->have_posts() ) { $service->the_post();
  135. $service_icon_image =sanitize_text_field( get_post_meta( get_the_ID(), 'service_icon_image', true ));
  136. $service_icon_target =sanitize_text_field( get_post_meta( get_the_ID(), 'service_icon_target', true ));
  137. $service_description_text =sanitize_text_field( get_post_meta( get_the_ID(), 'service_description_text', true ));
  138. ?>
  139. <?php if(($service_icon_target) && ($service_icon_image)){ ?>
  140. <div class="col-md-3 other-service-area">
  141. <i class="fa <?php if($service_icon_image) { echo $service_icon_image; } ?>"></i>
  142. <h2><?php the_title(); ?></h2>
  143. <p><?php if($service_description_text){ echo $service_description_text; } ?></p>
  144. </div>
  145. <?php } else {
  146.  
  147. $defalt_arg =array('class' => "img-responsive");
  148. if(has_post_thumbnail()){ ?>
  149. <div class="col-md-3 other-service-area service-box1">
  150. <?php the_post_thumbnail('', $defalt_arg); ?>
  151. <h2><?php the_title(); ?></h2>
  152. <p><?php if($service_description_text){ echo $service_description_text; } ?></p>
  153. </div>
  154. <?php } else { ?>
  155. <div class="col-md-3 other-service-area">
  156. <i class="fa" style="font-size:16px;"><?php _e('Icon','wallstreet'); ?></i>
  157. <h2><?php the_title(); ?></h2>
  158. <p><?php if($service_description_text){ echo $service_description_text; } ?></p>
  159. </div>
  160. <?php } }
  161. if($j%4==0){ echo "<div class='clearfix'></div>"; } $j++;
  162. } } else { ?>
  163. <?php
  164. $count_posts = wp_count_posts( 'wallstreet_service')->publish;
  165. $service_title = array(__('Responsive','wallstreet'), __('WordPress themes','wallstreet'), __('Mobile ready','wallstreet'), __('Live support','wallstreet'));
  166. $other_service_icon = array('fa-tablet', 'fa-tachometer', 'fa-mobile', 'fa-support');
  167. if( $count_posts >= 4 || $count_posts == 0 )
  168. {
  169. for($i=0 ; $i<=3 ; $i++)
  170. { ?>
  171. <div class="col-md-3 other-service-area">
  172. <a href=""><i class="fa <?php echo $other_service_icon[$i]; ?>"></i></a>
  173. <h2><?php echo $service_title[$i]; ?></h2>
  174. <p>Mauris rhoncus pretium porttitor Cras scelerisque commodo odio Phasellus dolor.</p>
  175. </div>
  176. <?php } } } ?>
  177. </div>
  178. <?php } ?>
  179. </div>
  180. <?php get_footer(); ?>
  181. <!-- /Our Other Service Section -->
Add Comment
Please, Sign In to add comment