Guest User

Untitled

a guest
Dec 27th, 2018
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.55 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. <div class="row">
  95. <div class="col-md-12" id="ser_addtional_content">
  96. <p> Have you found yourself questioning some of the truths you were taught in your religious community?
  97.  
  98. Are you feeling scared, lonely, confused, angry…?
  99.  
  100. Do people think or tell you that you are being deceived, led astray, lazy, selfish, sinful…?
  101.  
  102. I know this can be a profoundly difficult time in your life, especially if you’ve devoted your life to your faith and faith community.
  103.  
  104. But coming to this point where you question your faith and relationship with the Divine, your relationship with your faith community, is a normal part of faith development. How do I know this? Because I have been there before.
  105.  
  106. You will be okay. In fact, you will be more than okay. This journey leads to greater peace, understanding, and acceptance than you can imagine right now.</p>
  107.  
  108. </div>
  109. </div>
  110.  
  111. <!-- Section Title -->
  112. <div class="row">
  113. <div class="col-md-12">
  114. <div class="section-title">
  115. <?php if( $current_options['service_tag_line'] != '' ) { ?>
  116. <h1 class="section-heading"><?php echo $current_options['service_tag_line']; ?></h1>
  117. <?php } if( $current_options['service_tag_desciption'] != '' ) { ?>
  118. <p><?php echo $current_options['service_tag_desciption']; ?></p>
  119. <?php } ?>
  120. </div>
  121. </div>
  122. </div>
  123. <!-- /Section Title -->
  124.  
  125. <?php busiprof_service_content( $busiprof_service_content,$current_options ); ?>
  126.  
  127. <div class="clearfix"></div>
  128.  
  129.  
  130. <div class="col-md-12 col-xs-12">
  131. <?php if( $current_options['service_readmore_button'] != '' ) { ?>
  132. <div class="btn-wrap">
  133. <?php
  134. if( $current_options['service_readmore_link'] != '' )
  135. {
  136. $link = $current_options['service_readmore_link'];
  137. }
  138. ?>
  139. <a href="<?php echo $link; ?>" <?php if( $current_options['service_readmore_link_target'] == true ) { echo "target='_blank'"; } ?> ><?php echo $current_options['service_readmore_button'];
  140. ?>
  141. </a>
  142. </div>
  143. <?php } ?>
  144. </div>
  145. </div>
  146. </section>
  147. <!-- End of Service Section -->
  148.  
  149. <div class="clearfix"></div>
  150. <?php }
  151. function busiprof_service_content( $busiprof_service_content, $is_callback = false ) {
  152. $current_options = wp_parse_args( get_option( 'busiprof_pro_theme_options', array() ), theme_data_setup() );
  153. if ( ! $is_callback ) { ?>
  154. <div class="row busiprof-features-content">
  155. <?php
  156. }
  157. if ( ! empty( $busiprof_service_content ) ) {
  158. $allowed_html = array(
  159. 'br' => array(),
  160. 'em' => array(),
  161. 'strong' => array(),
  162. 'b' => array(),
  163. 'i' => array(),
  164. );
  165. $busiprof_service_content = json_decode( $busiprof_service_content );
  166. foreach ( $busiprof_service_content as $features_item ) :
  167. $icon = ! empty( $features_item->icon_value ) ? apply_filters( 'busiprof_translate_single_string', $features_item->icon_value, 'Features section' ) : '';
  168. $title = ! empty( $features_item->title ) ? apply_filters( 'busiprof_translate_single_string', $features_item->title, 'Features section' ) : '';
  169. $text = ! empty( $features_item->text ) ? apply_filters( 'busiprof_translate_single_string', $features_item->text, 'Features section' ) : '';
  170. $link = ! empty( $features_item->link ) ? apply_filters( 'busiprof_translate_single_string', $features_item->link, 'Features section' ) : '';
  171. $image = ! empty( $features_item->image_url ) ? apply_filters( 'busiprof_translate_single_string', $features_item->image_url, 'Features section' ) : '';
  172. $color = '';
  173. $color = $features_item->color;
  174.  
  175. ?>
  176. <div class="col-md-<?php echo $current_options['service_layout'] ?> col-sm-6 col-xs-12 service-box">
  177. <div class="post">
  178. <?php if ( ! empty( $image ) ) : ?>
  179. <?php if ( ! empty( $link ) ) : ?>
  180. <a href="<?php echo esc_url( $link ); ?>">
  181. <?php endif; ?>
  182. <img class="services_cols_mn_icon"
  183. src="<?php echo esc_url( $image ); ?>" <?php if ( ! empty( $title ) ) : ?> alt="<?php echo esc_attr( $title ); ?>" title="<?php echo esc_attr( $title ); ?>" <?php endif; ?> />
  184. <?php if ( ! empty( $link ) ) : ?>
  185. </a>
  186. <?php endif; ?>
  187. <?php endif; ?>
  188.  
  189. <?php if ( ! empty( $link ) ) : ?>
  190. <a href="<?php echo esc_url( $link ); ?>">
  191. <?php endif; ?>
  192. <?php if ( ! empty( $icon ) ) :?>
  193. <div class="service-icon" <?php if ( ! empty( $color ) ) { echo 'style="color:' . $color . '"'; } ?>>
  194. <i class="fa <?php echo esc_html( $icon ); ?>"></i>
  195. </div>
  196. <?php endif; ?>
  197. <?php if ( ! empty( $title ) ) : ?>
  198.  
  199. <div class="entry-header">
  200. <h4 class="entry-title"><?php echo esc_html( $title ); ?></h4>
  201. </div>
  202. <?php endif; ?>
  203. <?php if ( ! empty( $link ) ) : ?>
  204. </a>
  205. <?php endif; ?>
  206. <?php if ( ! empty( $text ) ) : ?>
  207.  
  208. <div class="entry-content">
  209. <p><?php echo wp_kses( html_entity_decode( $text ), $allowed_html ); ?></p>
  210. </div>
  211.  
  212.  
  213. <?php endif; ?>
  214. </div>
  215. </div>
  216. <?php
  217. endforeach;
  218. }
  219. else
  220. {
  221. $colors = array('#00bcd4','#e91e63','#4caf50', '#5ca2df');
  222. $title = array (__('Web Design','busiprof'), __('Unique Elements','busiprof'), __('User Friendly','busiprof'), __('24/7 Support','busiprof'));
  223. $icon = array('fa fa-laptop','fa fa-tasks','fa fa-thumbs-o-up','fa fa-life-ring');
  224. for($i=0; $i<=3; $i++) { ?>
  225. <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.">
  226. <div class="post">
  227. <a href="#">
  228. <div class="service-icon" style="color:<?php echo $colors[$i]; ?>">
  229. <i class="<?php echo $icon[$i]; ?>"></i>
  230. </div>
  231. <div class="entry-header">
  232. <h4 class="entry-title"><?php echo $title[$i]; ?></h4>
  233. </div>
  234. </a>
  235. <div class="entry-content">
  236. <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>
  237. </div>
  238. </div>
  239. </div>
  240. <?php }
  241. }
  242. if ( ! $is_callback ) { ?>
  243. </div>
  244. <?php
  245. }
  246. }
  247. /*
  248. if ( function_exists( 'busiprof_features' ) ) {
  249. $section_priority = apply_filters( 'busiprof_section_priority', 10, 'busiprof_features' );
  250. add_action( 'busiprof_sections', 'busiprof_features', absint( $section_priority ) );
  251. add_action( 'after_setup_theme', 'busiprof_features_register_strings', 11 );
  252. }*/
  253. ?>
Add Comment
Please, Sign In to add comment