Guest User

Untitled

a guest
Dec 16th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.22 KB | None | 0 0
  1. <?php
  2. $default_content = false;
  3. $current_options = get_option('busiprof_theme_options');
  4. $busiprof_service_content = get_theme_mod( 'busiprof_service_content', $default_content );
  5.  
  6. if(!empty($current_options)){
  7. if(empty($busiprof_service_content)){
  8.  
  9. $old_theme_servives = wp_parse_args( get_option( 'busiprof_theme_options', array() ), theme_setup_data() );;
  10. if($old_theme_servives['service_image_one']!= '' || $old_theme_servives['service_icon_one']!= '' || $old_theme_servives['service_title_one']!= '' || $old_theme_servives['service_text_one']!= ''
  11. || $old_theme_servives['service_image_two']!= '' || $old_theme_servives['service_icon_two']!= '' || $old_theme_servives['service_title_two']!= '' || $old_theme_servives['service_text_two']!= ''
  12. || $old_theme_servives['service_image_three']!= '' || $old_theme_servives['service_icon_three']!= '' || $old_theme_servives['service_title_three']!= '' || $old_theme_servives['service_text_three']!= ''
  13. ||$old_theme_servives['service_image_four']!= '' || $old_theme_servives['service_icon_four']!= '' || $old_theme_servives['service_title_four']!= '' || $old_theme_servives['service_text_four']!= '')
  14. {
  15.  
  16. $busiprof_service_content = json_encode( array(
  17. array(
  18. 'icon_value' => isset($old_theme_servives['service_icon_one'])? $old_theme_servives['service_icon_one']:'',
  19. 'image_url' => isset($old_theme_servives['service_image_one'])? $old_theme_servives['service_image_one']:'',
  20. 'title' => isset($old_theme_servives['service_title_one'])? $old_theme_servives['service_title_one']:'',
  21. 'text' => isset($old_theme_servives['service_text_one'])? $old_theme_servives['service_text_one']:'',
  22. 'link' => '',
  23. 'id' => 'customizer_repeater_56d7ea7f40b56',
  24. 'color' => '#e91e63',
  25. ),
  26. array(
  27. 'icon_value' => isset($old_theme_servives['service_icon_two'])? $old_theme_servives['service_icon_two']:'',
  28. 'image_url' => isset($old_theme_servives['service_image_two'])? $old_theme_servives['service_image_two']:'',
  29. 'title' => isset($old_theme_servives['service_title_two'])? $old_theme_servives['service_title_two']:'',
  30. 'text' => isset($old_theme_servives['service_text_two'])? $old_theme_servives['service_text_two']:'',
  31. 'link' => '',
  32. 'id' => 'customizer_repeater_56d7ea7f40b66',
  33. 'color' => '#00bcd4',
  34. ),
  35. array(
  36. 'icon_value' => isset($old_theme_servives['service_icon_three'])? $old_theme_servives['service_icon_three']:'',
  37. 'image_url' => isset($old_theme_servives['service_image_three'])? $old_theme_servives['service_image_three']:'',
  38. 'title' => isset($old_theme_servives['service_title_three'])? $old_theme_servives['service_title_three']:'',
  39. 'text' => isset($old_theme_servives['service_text_three'])? $old_theme_servives['service_text_three']:'',
  40. 'link' => '',
  41. 'id' => 'customizer_repeater_56d7ea7f40b86',
  42. 'color' => '#4caf50',
  43. ),
  44.  
  45. array(
  46. 'icon_value' => isset($old_theme_servives['service_icon_four'])? $old_theme_servives['service_icon_four']:'',
  47. 'image_url' => isset($old_theme_servives['service_image_four'])? $old_theme_servives['service_image_four']:'',
  48. 'title' => isset($old_theme_servives['service_title_four'])? $old_theme_servives['service_title_four']:'',
  49. 'text' => isset($old_theme_servives['service_text_four'])? $old_theme_servives['service_text_four']:'',
  50. 'link' => '',
  51. 'id' => 'customizer_repeater_56d7ea7f40b96',
  52. 'color' => '#4caf50',
  53. ),
  54.  
  55.  
  56. ) );
  57. }
  58. }
  59. }
  60.  
  61.  
  62. $current_options = wp_parse_args( get_option( 'busiprof_theme_options', array() ), theme_setup_data() ); ?>
  63. <section id="section" class="service">
  64. <div class="container">
  65. <div class="row">
  66. <div class="col-md-12">
  67. <div class="section-title">
  68. <?php if( $current_options['service_heading_one'] != '' ) { ?>
  69. <h1 class="section-heading"><?php echo $current_options['service_heading_one']; ?></h1>
  70. <?php } if( $current_options['service_tagline'] != '' ) { ?>
  71. <p><?php echo $current_options['service_tagline']; ?></p>
  72. <?php } ?>
  73. </div>
  74. </div>
  75. </div>
  76. <?php busiprof_service_content( $busiprof_service_content ); ?>
  77. <div class="clearfix"></div>
  78. <div class="col-md-12 col-xs-12">
  79. <div class="btn-wrap">
  80. <div class="services_more_btn">
  81. <?php if($current_options['service_link_btn']!='') {?>
  82. <a href="<?php echo esc_url($current_options['service_link_btn']); ?>">
  83. <?php } if($current_options['service_button_value']!='') {
  84. echo esc_html($current_options['service_button_value']); ?></a>
  85. <?php } ?>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. </section>
  91.  
  92. <?php
  93. /**
  94. * Get content for features section.
  95. *
  96. * @since 1.1.30
  97. * @access public
  98. * @param string busiprof_service_content Section content in json format.
  99. * @param bool $is_callback Flag to check if it's callback or not.
  100. */
  101. function busiprof_service_content( $busiprof_service_content, $is_callback = false ) {
  102. if ( ! $is_callback ) { ?>
  103. <div class="row busiprof-features-content">
  104. <?php
  105. }
  106. if ( ! empty( $busiprof_service_content ) ) {
  107. $allowed_html = array(
  108. 'br' => array(),
  109. 'em' => array(),
  110. 'strong' => array(),
  111. 'b' => array(),
  112. 'i' => array(),
  113. );
  114. $busiprof_service_content = json_decode( $busiprof_service_content );
  115. foreach ( $busiprof_service_content as $features_item ) :
  116. $icon = ! empty( $features_item->icon_value ) ? apply_filters( 'busiprof_translate_single_string', $features_item->icon_value, 'Features section' ) : '';
  117. $title = ! empty( $features_item->title ) ? apply_filters( 'busiprof_translate_single_string', $features_item->title, 'Features section' ) : '';
  118. $text = ! empty( $features_item->text ) ? apply_filters( 'busiprof_translate_single_string', $features_item->text, 'Features section' ) : '';
  119. $link = ! empty( $features_item->link ) ? apply_filters( 'busiprof_translate_single_string', $features_item->link, 'Features section' ) : '';
  120. $image = ! empty( $features_item->image_url ) ? apply_filters( 'hestia_translate_single_string', $features_item->image_url, 'Features section' ) : '';
  121. $color = '';
  122. if ( is_customize_preview() && ! empty( $features_item->color ) ) {
  123. $color = $features_item->color;
  124. }
  125. ?>
  126. <div class="col-md-4 col-sm-6 col-xs-12 service-box">
  127. <div class="post">
  128. <?php if ( ! empty( $image ) ) : ?>
  129. <?php if ( ! empty( $link ) ) : ?>
  130. <a href="<?php echo esc_url( $link ); ?>">
  131. <?php endif; ?>
  132. <img class="services_cols_mn_icon"
  133. src="<?php echo esc_url( $image ); ?>" <?php if ( ! empty( $title ) ) : ?> alt="<?php echo esc_attr( $title ); ?>" title="<?php echo esc_attr( $title ); ?>" <?php endif; ?> />
  134. <?php if ( ! empty( $link ) ) : ?>
  135. </a>
  136. <?php endif; ?>
  137. <?php endif; ?>
  138.  
  139. <?php if ( ! empty( $link ) ) : ?>
  140. <a href="<?php echo esc_url( $link ); ?>">
  141. <?php endif; ?>
  142. <?php if ( ! empty( $icon ) ) :?>
  143. <div class="service-icon" <?php if ( ! empty( $color ) ) { echo 'style="color:' . $color . '"'; } ?>>
  144. <i class="fa <?php echo esc_html( $icon ); ?>"></i>
  145. </div>
  146. <?php endif; ?>
  147. <?php if ( ! empty( $title ) ) : ?>
  148.  
  149. <div class="entry-header">
  150. <h4 class="entry-title"><?php echo esc_html( $title ); ?></h4>
  151. </div>
  152. <?php endif; ?>
  153. <?php if ( ! empty( $link ) ) : ?>
  154. </a>
  155. <?php endif; ?>
  156. <?php if ( ! empty( $text ) ) : ?>
  157.  
  158. <div class="entry-content">
  159. <p><?php echo wp_kses( html_entity_decode( $text ), $allowed_html ); ?></p>
  160. </div>
  161.  
  162.  
  163. <?php endif; ?>
  164. </div>
  165. </div>
  166. <?php
  167. endforeach;
  168. }
  169. else
  170. {
  171. $colors = array('#00bcd4','#e91e63','#4caf50', '#5ca2df');
  172. $title = array (__('Web Design','busiprof'), __('Unique Elements','busiprof'), __('User Friendly','busiprof'), __('24/7 Support','busiprof'));
  173. $icon = array('fa fa-laptop','fa fa-tasks','fa fa-thumbs-o-up','fa fa-life-ring');
  174. for($i=0; $i<=3; $i++) { ?>
  175. <div class="col-md-4 col-sm-6 col-xs-12 service-box" title="Shift-click to edit this widget.">
  176. <div class="post">
  177. <a href="#">
  178. <div class="service-icon" style="color:<?php echo $colors[$i]; ?>">
  179. <i class="<?php echo $icon[$i]; ?>"></i>
  180. </div>
  181. <div class="entry-header">
  182. <h4 class="entry-title"><?php echo $title[$i]; ?></h4>
  183. </div>
  184. </a>
  185. <div class="entry-content">
  186. <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>
  187. </div>
  188. </div>
  189. </div>
  190. <?php }
  191. }
  192. if ( ! $is_callback ) { ?>
  193. </div>
  194. <?php
  195. }
  196. }
  197.  
  198. if ( function_exists( 'busiprof_features' ) ) {
  199. $section_priority = apply_filters( 'busiprof_section_priority', 10, 'busiprof_features' );
  200. add_action( 'busiprof_sections', 'busiprof_features', absint( $section_priority ) );
  201. add_action( 'after_setup_theme', 'busiprof_features_register_strings', 11 );
  202. }
  203. ?>
Add Comment
Please, Sign In to add comment