Guest User

Untitled

a guest
Mar 29th, 2019
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.70 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. '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.  
  102. <p><?php echo "Enter your servie description enter your serice description "; ?></p>
  103.  
  104. <?php } ?>
  105. </div>
  106. </div>
  107. </div>
  108. <!-- /Section Title -->
  109.  
  110. <?php busiprof_service_content( $busiprof_service_content,$current_options ); ?>
  111.  
  112. <div class="clearfix"></div>
  113.  
  114.  
  115. <div class="col-md-12 col-xs-12">
  116. <?php if( $current_options['service_readmore_button'] != '' ) { ?>
  117. <div class="btn-wrap">
  118. <?php
  119. if( $current_options['service_readmore_link'] != '' )
  120. {
  121. $link = $current_options['service_readmore_link'];
  122. }
  123. ?>
  124. <a href="<?php echo $link; ?>" <?php if( $current_options['service_readmore_link_target'] == true ) { echo "target='_blank'"; } ?> ><?php echo $current_options['service_readmore_button'];
  125. ?>
  126. </a>
  127. </div>
  128. <?php } ?>
  129. </div>
  130. </div>
  131. </section>
  132. <!-- End of Service Section -->
  133.  
  134. <div class="clearfix"></div>
  135. <?php }
  136. function busiprof_service_content( $busiprof_service_content, $is_callback = false ) {
  137. $current_options = wp_parse_args( get_option( 'busiprof_pro_theme_options', array() ), theme_data_setup() );
  138. if ( ! $is_callback ) { ?>
  139. <div class="row busiprof-features-content">
  140. <?php
  141. }
  142. if ( ! empty( $busiprof_service_content ) ) {
  143. $allowed_html = array(
  144. 'br' => array(),
  145. 'em' => array(),
  146. 'strong' => array(),
  147. 'b' => array(),
  148. 'i' => array(),
  149. );
  150. $busiprof_service_content = json_decode( $busiprof_service_content );
  151. foreach ( $busiprof_service_content as $features_item ) :
  152. $icon = ! empty( $features_item->icon_value ) ? apply_filters( 'busiprof_translate_single_string', $features_item->icon_value, 'Features section' ) : '';
  153. $title = ! empty( $features_item->title ) ? apply_filters( 'busiprof_translate_single_string', $features_item->title, 'Features section' ) : '';
  154. $text = ! empty( $features_item->text ) ? apply_filters( 'busiprof_translate_single_string', $features_item->text, 'Features section' ) : '';
  155. $link = ! empty( $features_item->link ) ? apply_filters( 'busiprof_translate_single_string', $features_item->link, 'Features section' ) : '';
  156. $image = ! empty( $features_item->image_url ) ? apply_filters( 'busiprof_translate_single_string', $features_item->image_url, 'Features section' ) : '';
  157. $color = '';
  158. $color = $features_item->color;
  159.  
  160. ?>
  161. <div class="col-md-<?php echo $current_options['service_layout'] ?> col-sm-6 col-xs-12 service-box">
  162. <div class="post">
  163. <?php if ( ! empty( $image ) ) : ?>
  164. <?php if ( ! empty( $link ) ) : ?>
  165. <a href="<?php echo esc_url( $link ); ?>">
  166. <?php endif; ?>
  167. <img class="services_cols_mn_icon"
  168. src="<?php echo esc_url( $image ); ?>" <?php if ( ! empty( $title ) ) : ?> alt="<?php echo esc_attr( $title ); ?>" title="<?php echo esc_attr( $title ); ?>" <?php endif; ?> />
  169. <?php if ( ! empty( $link ) ) : ?>
  170. </a>
  171. <?php endif; ?>
  172. <?php endif; ?>
  173.  
  174. <?php if ( ! empty( $link ) ) : ?>
  175. <a href="<?php echo esc_url( $link ); ?>">
  176. <?php endif; ?>
  177. <?php if ( ! empty( $icon ) ) :?>
  178. <div class="service-icon" <?php if ( ! empty( $color ) ) { echo 'style="color:' . $color . '"'; } ?>>
  179. <i class="fa <?php echo esc_html( $icon ); ?>"></i>
  180. </div>
  181. <?php endif; ?>
  182. <?php if ( ! empty( $title ) ) : ?>
  183.  
  184. <div class="entry-header">
  185. <h4 class="entry-title"><?php echo esc_html( $title ); ?></h4>
  186. </div>
  187. <?php endif; ?>
  188. <?php if ( ! empty( $link ) ) : ?>
  189. </a>
  190. <?php endif; ?>
  191. <?php if ( ! empty( $text ) ) : ?>
  192.  
  193. <div class="entry-content">
  194. <p><?php echo wp_kses( html_entity_decode( $text ), $allowed_html ); ?></p>
  195. </div>
  196.  
  197.  
  198. <?php endif; ?>
  199. </div>
  200. </div>
  201. <?php
  202. endforeach;
  203. }
  204. else
  205. {
  206. $colors = array('#00bcd4','#e91e63','#4caf50', '#5ca2df');
  207. $title = array (__('Web Design','busiprof'), __('Unique Elements','busiprof'), __('User Friendly','busiprof'), __('24/7 Support','busiprof'));
  208. $icon = array('fa fa-laptop','fa fa-tasks','fa fa-thumbs-o-up','fa fa-life-ring');
  209. for($i=0; $i<=3; $i++) { ?>
  210. <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.">
  211. <div class="post">
  212. <a href="#">
  213. <div class="service-icon" style="color:<?php echo $colors[$i]; ?>">
  214. <i class="<?php echo $icon[$i]; ?>"></i>
  215. </div>
  216. <div class="entry-header">
  217. <h4 class="entry-title"><?php echo $title[$i]; ?></h4>
  218. </div>
  219. </a>
  220. <div class="entry-content">
  221. <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>
  222. </div>
  223. </div>
  224. </div>
  225. <?php }
  226. }
  227. if ( ! $is_callback ) { ?>
  228. </div>
  229. <?php
  230. }
  231. }
  232. /*
  233. if ( function_exists( 'busiprof_features' ) ) {
  234. $section_priority = apply_filters( 'busiprof_section_priority', 10, 'busiprof_features' );
  235. add_action( 'busiprof_sections', 'busiprof_features', absint( $section_priority ) );
  236. add_action( 'after_setup_theme', 'busiprof_features_register_strings', 11 );
  237. }*/
  238. ?>
Add Comment
Please, Sign In to add comment