Guest User

Untitled

a guest
May 13th, 2019
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.85 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. 'choice' => 'customizer_repeater_icon',
  88. 'text' => get_post_meta( get_the_ID(),'meta_service_description', true ),
  89. 'open_new_tab' => get_post_meta( get_the_ID(),'service_icon_target', true ),
  90. 'link' => get_post_meta( get_the_ID(),'service_icon_link', true ),
  91. 'id' => 'customizer_repeater_56d7ea7f40b96',
  92. 'color' => '#2A7BC1',
  93. );
  94. endwhile;
  95. $busiprof_service_content = json_encode($pro_service_data_old);
  96. }
  97. }elseif(!empty($lite_service_data)){
  98.  
  99.  
  100. $page = get_option( 'theme_mods_busiprof','');
  101. if($page!=''){
  102. foreach($page as $key => $value) {
  103. if($key == 'busiprof_service_content'){
  104. $busiprof_service_content = $value;
  105. }
  106. }
  107. }else{
  108. $service = get_option('busiprof_theme_options');
  109.  
  110. //$busiprof_service_content_control = $wp_customize->get_setting( 'busiprof_service_content' );
  111. //if ( ! empty( $busiprof_service_content_control ) ) {
  112. $busiprof_service_content = json_encode( array(
  113. array(
  114. 'icon_value' => isset($service['service_icon_one'])? $service['service_icon_one']:'',
  115. 'image_url' => isset($service['service_image_one'])? $service['service_image_one']:'',
  116. 'title' => isset($service['service_title_one'])? $service['service_title_one']:'',
  117. 'choice' => 'customizer_repeater_icon',
  118. 'text' => isset($service['service_text_one'])? $service['service_text_one']:'',
  119. 'link' => '',
  120. 'id' => 'customizer_repeater_56d7ea7f40b56',
  121. 'color' => '#e91e63',
  122. ),
  123. array(
  124. 'icon_value' => isset($service['service_icon_two'])? $service['service_icon_two']:'',
  125. 'image_url' => isset($service['service_image_two'])? $service['service_image_two']:'',
  126. 'choice' => 'customizer_repeater_icon',
  127. 'title' => isset($service['service_title_two'])? $service['service_title_two']:'',
  128. 'text' => isset($service['service_text_two'])? $service['service_text_two']:'',
  129. 'link' => '',
  130. 'id' => 'customizer_repeater_56d7ea7f40b66',
  131. 'color' => '#00bcd4',
  132. ),
  133. array(
  134. 'icon_value' => isset($service['service_icon_three'])? $service['service_icon_three']:'',
  135. 'image_url' => isset($service['service_image_three'])? $service['service_image_three']:'',
  136. 'choice' => 'customizer_repeater_icon',
  137. 'title' => isset($service['service_title_three'])? $service['service_title_three']:'',
  138. 'text' => isset($service['service_text_three'])? $service['service_text_three']:'',
  139. 'link' => '',
  140. 'id' => 'customizer_repeater_56d7ea7f40b86',
  141. 'color' => '#4caf50',
  142. ),
  143.  
  144. array(
  145. 'icon_value' => isset($service['service_icon_four'])? $service['service_icon_four']:'',
  146. 'image_url' => isset($service['service_image_four'])? $service['service_image_four']:'',
  147. 'title' => isset($service['service_title_four'])? $service['service_title_four']:'',
  148. 'choice' => 'customizer_repeater_icon',
  149. 'text' => isset($service['service_text_four'])? $service['service_text_four']:'',
  150. 'link' => '',
  151. 'id' => 'customizer_repeater_56d7ea7f40b96',
  152. 'color' => '#4caf50',
  153. ),
  154.  
  155.  
  156. ) );
  157. //}
  158. }
  159. }
  160. }
  161. ?>
  162.  
  163. <!-- Service Section -->
  164. <section id="section" class="service">
  165. <div class="container">
  166. <div class="col-md-12">
  167. <div class="section-title">
  168. <p>
  169. <?php
  170. the_post();
  171. the_content();
  172. ?>
  173. </p>
  174. </div>
  175. </div>
  176. </div>
  177.  
  178. <div class="container">
  179.  
  180. <!-- Section Title -->
  181. <div class="row">
  182. <div class="col-md-12">
  183. <div class="section-title">
  184. <?php if( $current_options['service_tag_line'] != '' ) { ?>
  185. <h1 class="section-heading"><?php echo $current_options['service_tag_line']; ?></h1>
  186. <?php } if( $current_options['service_tag_desciption'] != '' ) { ?>
  187. <p><?php echo $current_options['service_tag_desciption']; ?></p>
  188. <?php } ?>
  189. </div>
  190. </div>
  191. </div>
  192. <!-- /Section Title -->
  193. <?php busiprof_service_content( $busiprof_service_content );?>
  194. </section>
  195. <!-- End of Service Section -->
  196. <?php
  197.  
  198. function busiprof_service_content( $busiprof_service_content, $is_callback = false ) {
  199. if ( ! $is_callback ) { ?>
  200. <div class="row busiprof-features-content">
  201. <?php
  202. }
  203. if ( ! empty( $busiprof_service_content ) ) {
  204. $allowed_html = array(
  205. 'br' => array(),
  206. 'em' => array(),
  207. 'strong' => array(),
  208. 'b' => array(),
  209. 'i' => array(),
  210. );
  211. $busiprof_service_content = json_decode( $busiprof_service_content );
  212. foreach ( $busiprof_service_content as $features_item ) :
  213. $icon = ! empty( $features_item->icon_value ) ? apply_filters( 'busiprof_translate_single_string', $features_item->icon_value, 'Features section' ) : '';
  214. $title = ! empty( $features_item->title ) ? apply_filters( 'busiprof_translate_single_string', $features_item->title, 'Features section' ) : '';
  215. $text = ! empty( $features_item->text ) ? apply_filters( 'busiprof_translate_single_string', $features_item->text, 'Features section' ) : '';
  216. $link = ! empty( $features_item->link ) ? apply_filters( 'busiprof_translate_single_string', $features_item->link, 'Features section' ) : '';
  217. $image = ! empty( $features_item->image_url ) ? apply_filters( 'hestia_translate_single_string', $features_item->image_url, 'Features section' ) : '';
  218. $color = '';
  219. $color = $features_item->color;
  220. ?>
  221. <div class="col-md-3 col-sm-6 col-xs-12 service-box">
  222. <div class="post">
  223. <?php if($features_item->choice == 'customizer_repeater_image'){ ?>
  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($features_item->choice == 'customizer_repeater_icon'){ ?>
  239. <?php if ( ! empty( $icon ) ) :?>
  240. <div class="service-icon" <?php if ( ! empty( $color ) ) { echo 'style="color:' . $color . '"'; } ?>>
  241. <i class="fa <?php echo esc_html( $icon ); ?>"></i>
  242. </div>
  243. <?php endif; ?>
  244. <?php } ?>
  245. <?php if ( ! empty( $title ) ) : ?>
  246.  
  247. <div class="entry-header">
  248. <h4 class="entry-title"><?php echo esc_html( $title ); ?></h4>
  249. </div>
  250. <?php endif; ?>
  251. <?php if ( ! empty( $link ) ) : ?>
  252. </a>
  253. <?php endif; ?>
  254. <?php if ( ! empty( $text ) ) : ?>
  255.  
  256. <div class="entry-content">
  257. <p><?php echo wp_kses( html_entity_decode( $text ), $allowed_html ); ?></p>
  258. </div>
  259.  
  260.  
  261. <?php endif; ?>
  262. </div>
  263. </div>
  264. <?php
  265. endforeach;
  266. }
  267. else
  268. {
  269. $colors = array('#00bcd4','#e91e63','#4caf50', '#4caf50');
  270. $title = array (__('Web Design','busiprof'), __('Unique Elements','busiprof'), __('User Friendly','busiprof'), __('24/7 Support','busiprof'));
  271. $icon = array('fa fa-laptop','fa fa-tasks','fa fa-thumbs-o-up','fa fa-life-ring');
  272. for($i=0; $i<=3; $i++) { ?>
  273. <div class="col-md-3 col-sm-6 col-xs-12 service-box" title="Shift-click to edit this widget.">
  274. <div class="post">
  275. <a href="#">
  276. <div class="service-icon" style="color:<?php echo $colors[$i]; ?>">
  277. <i class="<?php echo $icon[$i]; ?>"></i>
  278. </div>
  279. <div class="entry-header">
  280. <h4 class="entry-title"><?php echo $title[$i]; ?></h4>
  281. </div>
  282. </a>
  283. <div class="entry-content">
  284. <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>
  285. </div>
  286. </div>
  287. </div>
  288. <?php }
  289. }
  290. if ( ! $is_callback ) { ?>
  291. </div>
  292. <?php
  293. }
  294. }
  295. /*
  296. if ( function_exists( 'busiprof_features' ) ) {
  297. $section_priority = apply_filters( 'busiprof_section_priority', 10, 'busiprof_features' );
  298. add_action( 'busiprof_sections', 'busiprof_features', absint( $section_priority ) );
  299. add_action( 'after_setup_theme', 'busiprof_features_register_strings', 11 );
  300. }*/
  301. ?>
  302.  
  303. <div class="clearfix"></div>
  304. <?php if($current_options['enable_testimonial_section_portfolio'] == 'on') {?>
  305. <!-- Testimonial Scroll Section -->
  306. <section class="testimonial-scroll">
  307. <div class="container">
  308. <div class="row">
  309.  
  310. <!-- Section Title -->
  311. <div class="col-md-12">
  312. <div class="section-title-mini border">
  313. <?php if( $current_options['testimonial_head'] != '' ) { ?>
  314. <h4 class="section-heading txt-color"><?php echo $current_options['testimonial_head'];?>
  315. <?php } if( $current_options['testimonial_tagline'] !='') { ?>
  316. <span><?php echo $current_options['testimonial_tagline'];?></span></h4>
  317. <?php } ?>
  318. <?php
  319. $testimonial_options = json_decode($testimonial_options);
  320. if(count ($testimonial_options)>1){
  321. ?>
  322. <!-- Pagination -->
  323. <ul class="testi-nav">
  324. <li><a class="testi-prev" href="#myTestimonial" data-slide="prev"></a></li>
  325. <li><a class="testi-next" href="#myTestimonial" data-slide="next"></a></li>
  326. </ul>
  327. <!-- /Pagination -->
  328. <?php
  329. }?>
  330. </div>
  331. </div>
  332. <!-- /Section Title -->
  333.  
  334. <div class="carousel slide" data-ride="carousel" data-type="multi" data-interval="3000" id="myTestimonial">
  335. <div class="carousel-inner">
  336. <?php
  337. $t=true;
  338.  
  339. if( $testimonial_options!='' )
  340. {
  341. foreach($testimonial_options as $testimonial_iteam){
  342.  
  343. $title = ! empty( $testimonial_iteam->title ) ? apply_filters( 'busiprof_translate_single_string', $testimonial_iteam->title, 'Testimonial section' ) : '';
  344. $test_desc = ! empty( $testimonial_iteam->text ) ? apply_filters( 'busiprof_translate_single_string', $testimonial_iteam->text, 'Testimonial section' ) : '';
  345. $test_link = ! empty( $testimonial_iteam->link ) ? apply_filters( 'busiprof_translate_single_string', $testimonial_iteam->link, 'Testimonial section' ) : '';
  346. $open_new_tab = $testimonial_iteam->open_new_tab;
  347.  
  348. $designation = ! empty( $testimonial_iteam->designation ) ? apply_filters( 'busiprof_translate_single_string', $testimonial_iteam->designation, 'Testimonial section' ) : '';
  349.  
  350.  
  351. ?>
  352. <div class="col-md-12 pull-left item <?php if( $t == true ){ echo 'active'; } $t = false; ?>">
  353. <div class="post">
  354. <?php $default_arg =array('class' => "img-circle"); ?>
  355. <figure class="post-thumbnail">
  356. <a href="<?php echo $test_link; ?>" <?php if($open_new_tab == 'yes'){ echo 'target="_blank"';}?>>
  357. <img alt="img" class="img-responsive" src="<?php echo $testimonial_iteam->image_url; ?>" draggable="false">
  358. </a>
  359. </figure>
  360.  
  361. <div class="entry-content">
  362. <p><?php echo $test_desc; ?></p>
  363. </div>
  364. <div class="media">
  365. <div class="media-body">
  366. <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>
  367. </div>
  368. </div>
  369. </div>
  370. </div>
  371. <?php } } else {
  372. $i=1;
  373. $args = array( 'post_type' => 'busiprof_testimonial') ;
  374. $tesimonials = new WP_Query( $args );
  375. if( $tesimonials->have_posts() )
  376. {
  377. while ( $tesimonials->have_posts() ) : $tesimonials->the_post();
  378.  
  379. ?>
  380. <div class="col-md-12 pull-left item <?php if($i == 1) echo "in active" ; ?>">
  381. <div class="post">
  382. <div class="entry-content">
  383. <p><?php echo get_post_meta( get_the_ID(), 'testimonial_desc', true ); ?></p>
  384. </div>
  385. <div class="media">
  386. <figure class="post-thumbnail width-sm">
  387. <?php if(has_post_thumbnail()){
  388. the_post_thumbnail( );
  389. } ?>
  390. </figure>
  391. <div class="media-body">
  392. <span class="author-name"><?php echo the_title() ;?> <small class="designation"><?php echo get_post_meta( get_the_ID(), 'author_designation', true ); ?></small></span>
  393. </div>
  394. </div>
  395. </div>
  396. </div>
  397. <?php if($i%4==0){ echo "<div class='clearfix'></div>";} $i++; endwhile; } } ?>
  398. </div>
  399. </div>
  400. </div>
  401. </div>
  402. </section>
  403. <!-- End of Testimonial Section -->
  404. <?php } if( $post->post_content != "" ) { ?>
  405. <!-- Other Service Section -->
  406. <section class="other-service">
  407. <div class="container">
  408. <div class="row">
  409. <div class="col-md-12 col-sm-12 col-xs-12">
  410. <div class="post">
  411. <div class="entry-content">
  412. <?php //the_post(); the_content(); ?>
  413. </div>
  414. </div>
  415. </div>
  416. </div>
  417. </div>
  418. </section>
  419. <!-- End of Other Service Section -->
  420. <?php } ?>
  421.  
  422. <div class="clearfix"></div>
  423.  
  424. <!-- Clients Section -->
  425. <?php if(($current_options['enable_client_section_portfolio'])=='on') { get_template_part('index','clientstrip'); }?>
  426. <!-- End of Clients Section -->
  427. <?php get_footer(); ?>
Add Comment
Please, Sign In to add comment