Advertisement
Guest User

Untitled

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