Guest User

Untitled

a guest
Jan 12th, 2019
24
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $default_content = false;
  3. $current_options = get_option('busiprof_pro_theme_options');
  4. $busiprof_service_content = get_theme_mod( 'busiprof_service_content');
  5. if(empty($busiprof_service_content))
  6. {
  7. $pro_service_data = get_option('busiprof_pro_theme_options');
  8. $lite_service_data = get_option('busiprof_theme_options');
  9. if(!empty($pro_service_data))
  10. {
  11. $args = array( 'post_type' => 'busiprof_service') ;
  12. $service = new WP_Query( $args );
  13. if( $service->have_posts() )
  14. {
  15. while ( $service->have_posts() ) : $service->the_post();
  16. $pro_service_data_old[] = array(
  17. 'icon_value' => get_post_meta( get_the_ID(),'service_icon_icons', true ),
  18. 'image_url' => get_the_post_thumbnail_url(),
  19. 'title' => get_the_title(),
  20. 'text' => get_post_meta( get_the_ID(),'meta_service_description', true ),
  21. 'open_new_tab' => get_post_meta( get_the_ID(),'service_icon_target', true ),
  22. 'link' => get_post_meta( get_the_ID(),'service_icon_link', true ),
  23. 'id' => 'customizer_repeater_56d7ea7f40b96',
  24. 'color' => '#2A7BC1',
  25. );
  26. endwhile;
  27. $busiprof_service_content = json_encode($pro_service_data_old);
  28. }
  29. }elseif(!empty($lite_service_data)){
  30.  
  31. $page = get_option( 'theme_mods_busiprof','');
  32. if($page!=''){
  33. foreach($page as $key => $value) {
  34. if($key == 'busiprof_service_content'){
  35. $busiprof_service_content = $value;
  36. }
  37. }
  38. }else{
  39. $service = get_option('busiprof_theme_options');
  40.  
  41. //$busiprof_service_content_control = $wp_customize->get_setting( 'busiprof_service_content' );
  42. //if ( ! empty( $busiprof_service_content_control ) ) {
  43. $busiprof_service_content = json_encode( array(
  44. array(
  45. 'icon_value' => isset($service['service_icon_one'])? $service['service_icon_one']:'',
  46. 'image_url' => isset($service['service_image_one'])? $service['service_image_one']:'',
  47. 'title' => isset($service['service_title_one'])? $service['service_title_one']:'',
  48. 'text' => isset($service['service_text_one'])? $service['service_text_one']:'',
  49. 'link' => '',
  50. 'id' => 'customizer_repeater_56d7ea7f40b56',
  51. 'color' => '#e91e63',
  52. ),
  53. array(
  54. 'icon_value' => isset($service['service_icon_two'])? $service['service_icon_two']:'',
  55. 'image_url' => isset($service['service_image_two'])? $service['service_image_two']:'',
  56. 'title' => isset($service['service_title_two'])? $service['service_title_two']:'',
  57. 'text' => isset($service['service_text_two'])? $service['service_text_two']:'',
  58. 'link' => '',
  59. 'id' => 'customizer_repeater_56d7ea7f40b66',
  60. 'color' => '#00bcd4',
  61. ),
  62. array(
  63. 'icon_value' => isset($service['service_icon_three'])? $service['service_icon_three']:'',
  64. 'image_url' => isset($service['service_image_three'])? $service['service_image_three']:'',
  65. 'title' => isset($service['service_title_three'])? $service['service_title_three']:'',
  66. 'text' => isset($service['service_text_three'])? $service['service_text_three']:'',
  67. 'link' => '',
  68. 'id' => 'customizer_repeater_56d7ea7f40b86',
  69. 'color' => '#4caf50',
  70. ),
  71.  
  72. array(
  73. 'icon_value' => isset($service['service_icon_four'])? $service['service_icon_four']:'',
  74. 'image_url' => isset($service['service_image_four'])? $service['service_image_four']:'',
  75. 'title' => isset($service['service_title_four'])? $service['service_title_four']:'',
  76. 'text' => isset($service['service_text_four'])? $service['service_text_four']:'',
  77. 'link' => '',
  78. 'id' => 'customizer_repeater_56d7ea7f40b96',
  79. 'color' => '#4caf50',
  80. ),
  81.  
  82.  
  83. ) );
  84. //}
  85. }
  86. }
  87. }
  88. $current_options = wp_parse_args( get_option( 'busiprof_pro_theme_options', array() ), theme_data_setup() );
  89. if( $current_options['home_service_section_enabled']=='on' ) { ?>
  90. <!-- Service Section -->
  91. <section id="section" class="service">
  92. <div class="container">
  93.  
  94. <!-- Section Title -->
  95. <div class="row">
  96. <div class="col-md-12">
  97. <div class="section-title">
  98. <?php if( $current_options['service_tag_line'] != '' ) { ?>
  99. <h1 class="section-heading"><?php echo $current_options['service_tag_line']; ?></h1>
  100. <?php } if( $current_options['service_tag_desciption'] != '' ) { ?>
  101. <p><?php echo $current_options['service_tag_desciption']; ?></p>
  102. <?php } ?>
  103. </div>
  104. </div>
  105. </div>
  106. <!-- /Section Title -->
  107.  
  108. <?php busiprof_service_content( $busiprof_service_content,$current_options ); ?>
  109.  
  110. <div class="clearfix"></div>
  111.  
  112.  
  113. <div class="col-md-12 col-xs-12">
  114. <?php if( $current_options['service_readmore_button'] != '' ) { ?>
  115. <div class="btn-wrap">
  116. <?php
  117. if( $current_options['service_readmore_link'] != '' )
  118. {
  119. $link = $current_options['service_readmore_link'];
  120. }
  121. ?>
  122. <a href="<?php echo $link; ?>" <?php if( $current_options['service_readmore_link_target'] == true ) { echo "target='_blank'"; } ?> ><?php echo $current_options['service_readmore_button'];
  123. ?>
  124. </a>
  125. </div>
  126. <?php } ?>
  127. </div>
  128. </div>
  129. </section>
  130. <!-- End of Service Section -->
  131.  
  132. <div class="clearfix"></div>
  133. <?php }
  134. function busiprof_service_content( $busiprof_service_content, $is_callback = false ) {
  135. $current_options = wp_parse_args( get_option( 'busiprof_pro_theme_options', array() ), theme_data_setup() );
  136. if ( ! $is_callback ) { ?>
  137. <div class="row busiprof-features-content">
  138. <?php
  139. }
  140. if ( ! empty( $busiprof_service_content ) ) {
  141. $allowed_html = array(
  142. 'br' => array(),
  143. 'em' => array(),
  144. 'strong' => array(),
  145. 'b' => array(),
  146. 'i' => array(),
  147. );
  148. $busiprof_service_content = json_decode( $busiprof_service_content );
  149. $cont_ser=0;
  150. foreach ( $busiprof_service_content as $features_item ) :
  151. $cont_ser++;
  152.  
  153. $icon = ! empty( $features_item->icon_value ) ? apply_filters( 'busiprof_translate_single_string', $features_item->icon_value, 'Features section' ) : '';
  154. $title = ! empty( $features_item->title ) ? apply_filters( 'busiprof_translate_single_string', $features_item->title, 'Features section' ) : '';
  155. $text = ! empty( $features_item->text ) ? apply_filters( 'busiprof_translate_single_string', $features_item->text, 'Features section' ) : '';
  156. $link = ! empty( $features_item->link ) ? apply_filters( 'busiprof_translate_single_string', $features_item->link, 'Features section' ) : '';
  157. $image = ! empty( $features_item->image_url ) ? apply_filters( 'busiprof_translate_single_string', $features_item->image_url, 'Features section' ) : '';
  158. $color = '';
  159. $color = $features_item->color;
  160.  
  161. ?>
  162. <div class="col-md-<?php echo $current_options['service_layout'] ?> col-sm-6 col-xs-12 service-box">
  163. <div class="post">
  164. <?php if ( ! empty( $image ) ) : ?>
  165. <?php if ( ! empty( $link ) ) : ?>
  166. <a href="<?php echo esc_url( $link ); ?>">
  167. <?php endif; ?>
  168. <img class="services_cols_mn_icon"
  169. src="<?php echo esc_url( $image ); ?>" <?php if ( ! empty( $title ) ) : ?> alt="<?php echo esc_attr( $title ); ?>" title="<?php echo esc_attr( $title ); ?>" <?php endif; ?> />
  170. <?php if ( ! empty( $link ) ) : ?>
  171. </a>
  172. <?php endif; ?>
  173. <?php endif; ?>
  174.  
  175. <?php if ( ! empty( $link ) ) : ?>
  176. <a href="<?php echo esc_url( $link ); ?>">
  177. <?php endif; ?>
  178. <?php if ( ! empty( $icon ) ) :?>
  179. <div class="service-icon" <?php if ( ! empty( $color ) ) { echo 'style="color:' . $color . '"'; } ?>>
  180. <i class="fa <?php echo esc_html( $icon ); ?>"></i>
  181. </div>
  182. <?php endif; ?>
  183. <?php if ( ! empty( $title ) ) : ?>
  184.  
  185. <div class="entry-header">
  186. <h4 class="entry-title"><?php echo esc_html( $title ); ?></h4>
  187. </div>
  188. <?php endif; ?>
  189. <?php if ( ! empty( $link ) ) : ?>
  190. </a>
  191. <?php endif; ?>
  192. <?php if ( ! empty( $text ) ) : ?>
  193.  
  194. <div class="entry-content">
  195. <p><?php echo wp_kses( html_entity_decode( $text ), $allowed_html ); ?></p>
  196. </div>
  197.  
  198.  
  199. <?php endif; ?>
  200. </div>
  201. </div>
  202. <?php
  203.  
  204. if ($cont_ser==6)
  205. {
  206. break;
  207.  
  208. }
  209. endforeach;
  210. }
  211. else
  212. {
  213. $colors = array('#00bcd4','#e91e63','#4caf50', '#5ca2df');
  214. $title = array (__('Web Design','busiprof'), __('Unique Elements','busiprof'), __('User Friendly','busiprof'), __('24/7 Support','busiprof'));
  215. $icon = array('fa fa-laptop','fa fa-tasks','fa fa-thumbs-o-up','fa fa-life-ring');
  216. for($i=0; $i<=3; $i++) { ?>
  217. <div class="col-md-<?php echo $current_options['service_layout'] ?> col-sm-6 col-xs-12 service-box" title="Shift-click to edit this widget.">
  218. <div class="post">
  219. <a href="#">
  220. <div class="service-icon" style="color:<?php echo $colors[$i]; ?>">
  221. <i class="<?php echo $icon[$i]; ?>"></i>
  222. </div>
  223. <div class="entry-header">
  224. <h4 class="entry-title"><?php echo $title[$i]; ?></h4>
  225. </div>
  226. </a>
  227. <div class="entry-content">
  228. <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>
  229. </div>
  230. </div>
  231. </div>
  232. <?php }
  233. }
  234. if ( ! $is_callback ) { ?>
  235. </div>
  236. <?php
  237. }
  238. }
  239. /*
  240. if ( function_exists( 'busiprof_features' ) ) {
  241. $section_priority = apply_filters( 'busiprof_section_priority', 10, 'busiprof_features' );
  242. add_action( 'busiprof_sections', 'busiprof_features', absint( $section_priority ) );
  243. add_action( 'after_setup_theme', 'busiprof_features_register_strings', 11 );
  244. }*/
  245. ?>
RAW Paste Data