Guest User

Untitled

a guest
Sep 4th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.22 KB | None | 0 0
  1. <?php
  2. //Template Name: Service
  3. get_header ();
  4. get_template_part('index', 'bannerstrip');
  5.  
  6. //$default_content = false;
  7. //$busiprof_features_content = get_theme_mod( 'busiprof_pro_theme_options', $default_content );
  8. $testimonial_options = get_theme_mod('busiprof_testimonial_content');
  9. if(empty($testimonial_options))
  10. {
  11. $pro_testimonial_data = get_option('busiprof_pro_theme_options');
  12. $lite_testimonial_data = get_option('busiprof_theme_options');
  13. if(!empty($pro_testimonial_data))
  14. {
  15. $args = array( 'post_type' => 'busiprof_testimonial') ;
  16. $testimonial = new WP_Query( $args );
  17. if( $testimonial->have_posts() )
  18. {
  19.  
  20. while ( $testimonial->have_posts() ) : $testimonial->the_post();
  21. $pro_tesitimonial_data_old[] = array(
  22. 'title' => get_the_title(),
  23. 'text' => get_post_meta( get_the_ID(), 'testimonial_desc', true ),
  24. 'designation' => get_post_meta( get_the_ID(), 'author_designation', true ),
  25. 'link' => get_post_meta( get_the_ID(), 'author_link', true ),
  26. 'image_url' => get_the_post_thumbnail_url(),
  27. 'open_new_tab' => get_post_meta( get_the_ID(),'author_link_target', true ),
  28. 'id' => 'customizer_repeater_56d7ea7f40b96',
  29. );
  30. endwhile;
  31. $testimonial_options = json_encode($pro_tesitimonial_data_old);
  32. }
  33. }elseif(!empty($lite_testimonial_data)){
  34. $page = get_option( 'theme_mods_busiprof','');
  35. if($page!=''){
  36. foreach($page as $key => $value) {
  37. if($key == 'busiprof_testimonial_content'){
  38. $testimonial_options = $value;
  39. }
  40. }
  41. }else {
  42. $old_testimonial_data = get_option( 'busiprof_theme_options');
  43.  
  44. $testimonial_options = json_encode( array(
  45. array(
  46. 'title' => isset($old_testimonial_data['testimonials_name_one'])? $old_testimonial_data['testimonials_name_one']:'Robert Johnson',
  47. 'text' => isset($old_testimonial_data['testimonials_text_one'])? $old_testimonial_data['testimonials_text_one']:'We are group of passionate designers and developers who really love to create wordpress themes with amazing support. Widest laborum dolo rumes fugats untras. Ethar omnis iste natus error sit voluptatem accusantiexplicabo. Nemo enim ipsam eque porro quisquam est, qui dolorem ipsum am quaerat voluptatem...',
  48. 'designation' => isset($old_testimonial_data['testimonials_designation_one'])? $old_testimonial_data['testimonials_designation_one']:'(CEO & Founder)',
  49. 'link' => '#',
  50. 'image_url' => isset($old_testimonial_data['testimonials_image_one'])? $old_testimonial_data['testimonials_image_one']:get_template_directory_uri()."/images/item12.jpg",
  51. 'id' => 'customizer_repeater_56d7ea7f40b96',
  52. 'open_new_tab' => 'no',
  53.  
  54. ),
  55. array(
  56. 'title' => isset($old_testimonial_data['testimonials_name_two'])? $old_testimonial_data['testimonials_name_two']:'Annah Doe',
  57. 'text' => isset($old_testimonial_data['testimonials_text_two'])? $old_testimonial_data['testimonials_text_two']:'We are group of passionate designers and developers who really love to create wordpress themes with amazing support. Widest laborum dolo rumes fugats untras. Ethar omnis iste natus error sit voluptatem accusantiexplicabo. Nemo enim ipsam eque porro quisquam est, qui dolorem ipsum am quaerat voluptatem...',
  58. 'designation' => isset($old_testimonial_data['testimonials_designation_two'])? $old_testimonial_data['testimonials_designation_two']:'(Team Leader)',
  59. 'link' => '#',
  60. 'image_url' => isset($old_testimonial_data['testimonials_image_two'])? $old_testimonial_data['testimonials_image_two']:get_template_directory_uri()."/images/item12.jpg",
  61. 'id' => 'customizer_repeater_56d7ea7f40b97',
  62. 'open_new_tab' => 'no',
  63.  
  64. ),
  65. ) );
  66. }
  67. }
  68.  
  69. }
  70.  
  71. $busiprof_service_content = get_theme_mod( 'busiprof_service_content');
  72. if(empty($busiprof_service_content))
  73. {
  74. $pro_service_data = get_option('busiprof_pro_theme_options');
  75. $lite_service_data = get_option('busiprof_theme_options');
  76. if(!empty($pro_service_data))
  77. {
  78. $args = array( 'post_type' => 'busiprof_service') ;
  79. $service = new WP_Query( $args );
  80. if( $service->have_posts() )
  81. {
  82. while ( $service->have_posts() ) : $service->the_post();
  83. $pro_service_data_old[] = array(
  84. 'icon_value' => get_post_meta( get_the_ID(),'service_icon_icons', true ),
  85. 'image_url' => get_the_post_thumbnail_url(),
  86. 'title' => get_the_title(),
  87. 'text' => get_post_meta( get_the_ID(),'meta_service_description', true ),
  88. 'open_new_tab' => get_post_meta( get_the_ID(),'service_icon_target', true ),
  89. 'link' => get_post_meta( get_the_ID(),'service_icon_link', true ),
  90. 'id' => 'customizer_repeater_56d7ea7f40b96',
  91. 'color' => '#2A7BC1',
  92. );
  93. endwhile;
  94. $busiprof_service_content = json_encode($pro_service_data_old);
  95. }
  96. }elseif(!empty($lite_service_data)){
  97.  
  98.  
  99. $page = get_option( 'theme_mods_busiprof','');
  100. if($page!=''){
  101. foreach($page as $key => $value) {
  102. if($key == 'busiprof_service_content'){
  103. $busiprof_service_content = $value;
  104. }
  105. }
  106. }else{
  107. $service = get_option('busiprof_theme_options');
  108.  
  109. //$busiprof_service_content_control = $wp_customize->get_setting( 'busiprof_service_content' );
  110. //if ( ! empty( $busiprof_service_content_control ) ) {
  111. $busiprof_service_content = json_encode( array(
  112. array(
  113. 'icon_value' => isset($service['service_icon_one'])? $service['service_icon_one']:'',
  114. 'image_url' => isset($service['service_image_one'])? $service['service_image_one']:'',
  115. 'title' => isset($service['service_title_one'])? $service['service_title_one']:'',
  116. 'text' => isset($service['service_text_one'])? $service['service_text_one']:'',
  117. 'link' => '',
  118. 'id' => 'customizer_repeater_56d7ea7f40b56',
  119. 'color' => '#e91e63',
  120. ),
  121. array(
  122. 'icon_value' => isset($service['service_icon_two'])? $service['service_icon_two']:'',
  123. 'image_url' => isset($service['service_image_two'])? $service['service_image_two']:'',
  124. 'title' => isset($service['service_title_two'])? $service['service_title_two']:'',
  125. 'text' => isset($service['service_text_two'])? $service['service_text_two']:'',
  126. 'link' => '',
  127. 'id' => 'customizer_repeater_56d7ea7f40b66',
  128. 'color' => '#00bcd4',
  129. ),
  130. array(
  131. 'icon_value' => isset($service['service_icon_three'])? $service['service_icon_three']:'',
  132. 'image_url' => isset($service['service_image_three'])? $service['service_image_three']:'',
  133. 'title' => isset($service['service_title_three'])? $service['service_title_three']:'',
  134. 'text' => isset($service['service_text_three'])? $service['service_text_three']:'',
  135. 'link' => '',
  136. 'id' => 'customizer_repeater_56d7ea7f40b86',
  137. 'color' => '#4caf50',
  138. ),
  139.  
  140. array(
  141. 'icon_value' => isset($service['service_icon_four'])? $service['service_icon_four']:'',
  142. 'image_url' => isset($service['service_image_four'])? $service['service_image_four']:'',
  143. 'title' => isset($service['service_title_four'])? $service['service_title_four']:'',
  144. 'text' => isset($service['service_text_four'])? $service['service_text_four']:'',
  145. 'link' => '',
  146. 'id' => 'customizer_repeater_56d7ea7f40b96',
  147. 'color' => '#4caf50',
  148. ),
  149.  
  150.  
  151. ) );
  152. //}
  153. }
  154. }
  155. }
  156. ?>
  157.  
  158. <!-- Other Service Section -->
  159. <section class="other-service">
  160. <div class="container">
  161. <div class="row">
  162. <div class="col-md-12 col-sm-12 col-xs-12">
  163. <div class="post">
  164. <div class="entry-content">
  165. <?php the_post(); the_content(); ?>
  166. </div>
  167. </div>
  168. </div>
  169. </div>
  170. </div>
  171. </section>
  172. <!-- End of Other Service Section -->
  173.  
  174. <!-- Service Section -->
  175.  
  176. <section id="section" class="service">
  177. <div class="container">
  178.  
  179. <!-- Section Title -->
  180. <div class="row">
  181. <div class="col-md-12">
  182. <div class="section-title">
  183. <?php if( $current_options['service_tag_line'] != '' ) { ?>
  184. <h1 class="section-heading"><?php echo $current_options['service_tag_line']; ?></h1>
  185. <?php } if( $current_options['service_tag_desciption'] != '' ) { ?>
  186. <p><?php echo $current_options['service_tag_desciption']; ?></p>
  187. <?php } ?>
  188. </div>
  189. </div>
  190. </div>
  191. <!-- /Section Title -->
  192. <?php busiprof_service_content( $busiprof_service_content );?>
  193. </section>
  194. <!-- End of Service Section -->
  195. <?php
  196.  
  197. function busiprof_service_content( $busiprof_service_content, $is_callback = false ) {
  198. if ( ! $is_callback ) { ?>
  199. <div class="row busiprof-features-content">
  200. <?php
  201. }
  202. if ( ! empty( $busiprof_service_content ) ) {
  203. $allowed_html = array(
  204. 'br' => array(),
  205. 'em' => array(),
  206. 'strong' => array(),
  207. 'b' => array(),
  208. 'i' => array(),
  209. );
  210. $busiprof_service_content = json_decode( $busiprof_service_content );
  211. foreach ( $busiprof_service_content as $features_item ) :
  212. $icon = ! empty( $features_item->icon_value ) ? apply_filters( 'busiprof_translate_single_string', $features_item->icon_value, 'Features section' ) : '';
  213. $title = ! empty( $features_item->title ) ? apply_filters( 'busiprof_translate_single_string', $features_item->title, 'Features section' ) : '';
  214. $text = ! empty( $features_item->text ) ? apply_filters( 'busiprof_translate_single_string', $features_item->text, 'Features section' ) : '';
  215. $link = ! empty( $features_item->link ) ? apply_filters( 'busiprof_translate_single_string', $features_item->link, 'Features section' ) : '';
  216. $image = ! empty( $features_item->image_url ) ? apply_filters( 'hestia_translate_single_string', $features_item->image_url, 'Features section' ) : '';
  217. $color = '';
  218. if ( is_customize_preview() && ! empty( $features_item->color ) ) {
  219. $color = $features_item->color;
  220. }
  221. ?>
  222. <div class="col-md-3 col-sm-6 col-xs-12 service-box">
  223. <div class="post">
  224. <?php if ( ! empty( $image ) ) : ?>
  225. <?php if ( ! empty( $link ) ) : ?>
  226. <a href="<?php echo esc_url( $link ); ?>">
  227. <?php endif; ?>
  228. <img class="services_cols_mn_icon"
  229. src="<?php echo esc_url( $image ); ?>" <?php if ( ! empty( $title ) ) : ?> alt="<?php echo esc_attr( $title ); ?>" title="<?php echo esc_attr( $title ); ?>" <?php endif; ?> />
  230. <?php if ( ! empty( $link ) ) : ?>
  231. </a>
  232. <?php endif; ?>
  233. <?php endif; ?>
  234.  
  235. <?php if ( ! empty( $link ) ) : ?>
  236. <a href="<?php echo esc_url( $link ); ?>">
  237. <?php endif; ?>
  238. <?php if ( ! empty( $icon ) ) :?>
  239. <div class="service-icon" <?php if ( ! empty( $color ) ) { echo 'style="color:' . $color . '"'; } ?>>
  240. <i class="fa <?php echo esc_html( $icon ); ?>"></i>
  241. </div>
  242. <?php endif; ?>
  243. <?php if ( ! empty( $title ) ) : ?>
  244.  
  245. <div class="entry-header">
  246. <h4 class="entry-title"><?php echo esc_html( $title ); ?></h4>
  247. </div>
  248. <?php endif; ?>
  249. <?php if ( ! empty( $link ) ) : ?>
  250. </a>
  251. <?php endif; ?>
  252. <?php if ( ! empty( $text ) ) : ?>
  253.  
  254. <div class="entry-content">
  255. <p><?php echo wp_kses( html_entity_decode( $text ), $allowed_html ); ?></p>
  256. </div>
  257.  
  258.  
  259. <?php endif; ?>
  260. </div>
  261. </div>
  262. <?php
  263. endforeach;
  264. }
  265. else
  266. {
  267. $colors = array('#00bcd4','#e91e63','#4caf50', '#4caf50');
  268. $title = array (__('Web Design','busiprof'), __('Unique Elements','busiprof'), __('User Friendly','busiprof'), __('24/7 Support','busiprof'));
  269. $icon = array('fa fa-laptop','fa fa-tasks','fa fa-thumbs-o-up','fa fa-life-ring');
  270. for($i=0; $i<=3; $i++) { ?>
  271. <div class="col-md-3 col-sm-6 col-xs-12 service-box" title="Shift-click to edit this widget.">
  272. <div class="post">
  273. <a href="#">
  274. <div class="service-icon" style="color:<?php echo $colors[$i]; ?>">
  275. <i class="<?php echo $icon[$i]; ?>"></i>
  276. </div>
  277. <div class="entry-header">
  278. <h4 class="entry-title"><?php echo $title[$i]; ?></h4>
  279. </div>
  280. </a>
  281. <div class="entry-content">
  282. <p><?php echo _e('It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.','busiprof'); ?></p>
  283. </div>
  284. </div>
  285. </div>
  286. <?php }
  287. }
  288. if ( ! $is_callback ) { ?>
  289. </div>
  290. <?php
  291. }
  292. }
  293. /*
  294. if ( function_exists( 'busiprof_features' ) ) {
  295. $section_priority = apply_filters( 'busiprof_section_priority', 10, 'busiprof_features' );
  296. add_action( 'busiprof_sections', 'busiprof_features', absint( $section_priority ) );
  297. add_action( 'after_setup_theme', 'busiprof_features_register_strings', 11 );
  298. }*/
  299. ?>
  300.  
  301. <div class="clearfix"></div>
  302. <?php if($current_options['enable_testimonial_section_portfolio'] == 'on') {?>
  303. <!-- Testimonial Scroll Section -->
  304. <section class="testimonial-scroll">
  305. <div class="container">
  306. <div class="row">
  307.  
  308. <!-- Section Title -->
  309. <div class="col-md-12">
  310. <div class="section-title-mini border">
  311. <?php if( $current_options['testimonial_head'] != '' ) { ?>
  312. <h4 class="section-heading txt-color"><?php echo $current_options['testimonial_head'];?>
  313. <?php } if( $current_options['testimonial_tagline'] !='') { ?>
  314. <span><?php echo $current_options['testimonial_tagline'];?></span></h4>
  315. <?php } ?>
  316. <?php
  317. $testimonial_options = json_decode($testimonial_options);
  318. if(count ($testimonial_options)>1){
  319. ?>
  320. <!-- Pagination -->
  321. <ul class="testi-nav">
  322. <li><a class="testi-prev" href="#myTestimonial" data-slide="prev"></a></li>
  323. <li><a class="testi-next" href="#myTestimonial" data-slide="next"></a></li>
  324. </ul>
  325. <!-- /Pagination -->
  326. <?php
  327. }?>
  328. </div>
  329. </div>
  330. <!-- /Section Title -->
  331.  
  332. <div class="carousel slide" data-ride="carousel" data-type="multi" data-interval="3000" id="myTestimonial">
  333. <div class="carousel-inner">
  334. <?php
  335. $t=true;
  336.  
  337. if( $testimonial_options!='' )
  338. {
  339. foreach($testimonial_options as $testimonial_iteam){
  340.  
  341. $title = ! empty( $testimonial_iteam->title ) ? apply_filters( 'busiprof_translate_single_string', $testimonial_iteam->title, 'Testimonial section' ) : '';
  342. $test_desc = ! empty( $testimonial_iteam->text ) ? apply_filters( 'busiprof_translate_single_string', $testimonial_iteam->text, 'Testimonial section' ) : '';
  343. $test_link = $testimonial_iteam->link;
  344. $open_new_tab = $testimonial_iteam->open_new_tab;
  345.  
  346. $designation = ! empty( $testimonial_iteam->designation ) ? apply_filters( 'busiprof_translate_single_string', $testimonial_iteam->designation, 'Testimonial section' ) : '';
  347.  
  348.  
  349. ?>
  350. <div class="col-md-12 pull-left item <?php if( $t == true ){ echo 'active'; } $t = false; ?>">
  351. <div class="post">
  352. <?php $default_arg =array('class' => "img-circle"); ?>
  353. <figure class="post-thumbnail">
  354. <a href="<?php echo $test_link; ?>" <?php if($open_new_tab == 'yes'){ echo 'target="_blank"';}?>>
  355. <img alt="img" class="img-responsive" src="<?php echo $testimonial_iteam->image_url; ?>" draggable="false">
  356. </a>
  357. </figure>
  358.  
  359. <div class="entry-content">
  360. <p><?php echo $test_desc; ?></p>
  361. </div>
  362. <div class="media">
  363. <div class="media-body">
  364. <span class="author-name"> <a href="<?php echo $test_link; ?>" <?php if($open_new_tab == 'yes'){ echo 'target="_blank"';}?>> <?php echo $title; ?> </a> <small class="designation"><?php echo $designation; ?></small></span>
  365. </div>
  366. </div>
  367. </div>
  368. </div>
  369. <?php } } else {
  370. $i=1;
  371. $args = array( 'post_type' => 'busiprof_testimonial') ;
  372. $tesimonials = new WP_Query( $args );
  373. if( $tesimonials->have_posts() )
  374. {
  375. while ( $tesimonials->have_posts() ) : $tesimonials->the_post();
  376.  
  377. ?>
  378. <div class="col-md-12 pull-left item <?php if($i == 1) echo "in active" ; ?>">
  379. <div class="post">
  380. <div class="entry-content">
  381. <p><?php echo get_post_meta( get_the_ID(), 'testimonial_desc', true ); ?></p>
  382. </div>
  383. <div class="media">
  384. <figure class="post-thumbnail width-sm">
  385. <?php if(has_post_thumbnail()){
  386. the_post_thumbnail( );
  387. } ?>
  388. </figure>
  389. <div class="media-body">
  390. <span class="author-name"><?php echo the_title() ;?> <small class="designation"><?php echo get_post_meta( get_the_ID(), 'author_designation', true ); ?></small></span>
  391. </div>
  392. </div>
  393. </div>
  394. </div>
  395. <?php if($i%4==0){ echo "<div class='clearfix'></div>";} $i++; endwhile; } } ?>
  396. </div>
  397. </div>
  398. </div>
  399. </div>
  400. </section>
  401. <!-- End of Testimonial Section -->
  402. <?php } if( $post->post_content != "" ) { ?>
  403.  
  404. <?php } ?>
  405.  
  406. <div class="clearfix"></div>
  407.  
  408. <!-- Clients Section -->
  409. <?php if(($current_options['enable_client_section_portfolio'])=='on') { get_template_part('index','clientstrip'); }?>
  410. <!-- End of Clients Section -->
  411. <?php get_footer(); ?>
Add Comment
Please, Sign In to add comment