Guest User

Untitled

a guest
May 20th, 2019
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.60 KB | None | 0 0
  1. <?php
  2. $slide_options = get_theme_mod('busiprof_slider_content');
  3.  
  4. if(empty($slide_options))
  5. {
  6. $lite_slider_data = get_option('busiprof_theme_options');
  7. $pro_slider_data = get_option('busiprof_pro_theme_options');
  8. if(!empty($pro_slider_data))
  9. {
  10. $args = array( 'post_type' => 'busiprof_slider') ;
  11. $slider = new WP_Query( $args );
  12. if( $slider->have_posts() )
  13. {
  14. while ( $slider->have_posts() ) : $slider->the_post();
  15. $pro_slider_data_old[] = array(
  16. 'title' => get_the_title(),
  17. 'text' => sanitize_text_field( get_post_meta( get_the_ID(),'image_description', true )),
  18. 'button_text' => sanitize_text_field( get_post_meta( get_the_ID(),'readmore_button', true )),
  19. 'link' => sanitize_text_field( get_post_meta( get_the_ID(),'readmore_link', true )),
  20. 'image_url' => get_the_post_thumbnail_url(),
  21. 'open_new_tab' => isset($data['readmore_target'])? $data['readmore_target'] : false,
  22. 'id' => 'customizer_repeater_56d7ea7f40b50',
  23. );
  24. endwhile;
  25. $slide_options = json_encode($pro_slider_data_old);
  26. }
  27. }elseif(!empty($lite_slider_data))
  28. {
  29.  
  30.  
  31.  
  32. $slide_options = json_encode( array(
  33. array(
  34. 'title' => isset($lite_slider_data['caption_head'])? $lite_slider_data['caption_head']:'Responsive WP theme',
  35. 'text' => isset($lite_slider_data['caption_text'])? $lite_slider_data['caption_text'] :'We are a group of passionate designers and developers who really love to create awesome wordpress themes with amazing support and cooles video documentations.',
  36. 'button_text' => isset($lite_slider_data['readmore_text'])? $lite_slider_data['readmore_text'] : 'Read more',
  37. 'link' => isset($lite_slider_data['readmore_text_link'])? $lite_slider_data['readmore_text_link'] : '#',
  38. 'image_url' => isset($lite_slider_data['slider_image'])? $lite_slider_data['slider_image'] : get_template_directory_uri().'/images/slide1.jpg',
  39. 'open_new_tab' => isset($lite_slider_data['readmore_target'])? $lite_slider_data['readmore_target'] : false,
  40. 'id' => 'customizer_repeater_56d7ea7f40b50',
  41. ),
  42. ) );
  43. }
  44. }
  45.  
  46. $current_options = wp_parse_args( get_option( 'busiprof_pro_theme_options', array() ), theme_data_setup() );
  47. require( BUSI_THEME_FUNCTIONS_PATH . '/scripts/indexslider-script.php' );
  48. ?>
  49. <div class="clearfix"></div>
  50.  
  51. <!-- Slider -->
  52. <?php if( $current_options['home_page_slider_enabled'] == 'on' ) { ?>
  53. <div id="main" role="main">
  54. <section class="slider">
  55. <div id="slider" class="flexslider">
  56. <ul class="slides">
  57. <?php
  58. $slide_options = json_decode($slide_options);
  59.  
  60. if( $slide_options!='' )
  61. {
  62. $allowed_html = array(
  63. 'br' => array(),
  64. 'em' => array(),
  65. 'strong' => array(),
  66. 'b' => array(),
  67. 'i' => array(),
  68. );
  69.  
  70. foreach($slide_options as $slide_iteam){?>
  71. <li>
  72. <?php if($slide_iteam->image_url!=''){ ?>
  73. <img alt="img" class="img-responsive" src="<?php echo $slide_iteam->image_url; ?>" draggable="false">
  74.  
  75. <?php
  76. }
  77.  
  78. $title = ! empty( $slide_iteam->title ) ? apply_filters( 'busiprof_translate_single_string', $slide_iteam->title, 'Slider section' ) : '';
  79. $img_description = ! empty( $slide_iteam->text ) ? apply_filters( 'busiprof_translate_single_string', $slide_iteam->text, 'Slider section' ) : '';
  80. $readmorelink = ! empty( $slide_iteam->link ) ? apply_filters( 'busiprof_translate_single_string', $slide_iteam->link, 'Slider section' ) : '';
  81. $readmore_button = ! empty( $slide_iteam->button_text ) ? apply_filters( 'busiprof_translate_single_string', $slide_iteam->button_text, 'Slider section' ) : '';
  82. $open_new_tab = $slide_iteam->open_new_tab;
  83. ?>
  84. <div class="container">
  85. <?php if($title!= '' || $img_description!= '' || $readmore_button!=''){ ?>
  86. <div class="slide-caption">
  87. <?php if($title!= '') { ?>
  88. <h2><?php echo $title; ?></h2>
  89. <?php }
  90. if($img_description!= '') {?>
  91. <p><?php //echo $img_description ;?></p>
  92. <p><?php echo wp_kses( html_entity_decode( $img_description ), $allowed_html ); ?></p>
  93.  
  94. <?php }?>
  95. <div>
  96. <?php if($readmore_button!='' ) { ?>
  97. <a href="<?php echo $readmorelink ;?>" <?php if($open_new_tab== 'yes') { echo "target='_blank'"; } ?> class="flex-btn">
  98. <?php echo $readmore_button ?>
  99. </a>
  100. <?php } ?>
  101. </div>
  102. </div>
  103. <?php } ?>
  104. </div>
  105. </li>
  106. <?php }
  107. } else { ?>
  108. <li>
  109. <img alt="img" src="<?php echo get_template_directory_uri(); ?>/images/slide1.jpg" />
  110. <div class="container">
  111. <div class="slide-caption">
  112. <h2><?php _e('Responsive WP theme','busiprof'); ?></h2>
  113. <p><?php _e('We are a group of passionate designers and developers who love to create awesome WordPress themes with an amazing support and the coolest video documentation.','busiprof'); ?></p>
  114. <div><a href="#" class="flex-btn"><?php _e('Read More','busiprof'); ?></a></div>
  115. </div>
  116. </div>
  117. </li>
  118. <li>
  119. <img alt="img" src="<?php echo get_template_directory_uri(); ?>/images/slide2.jpg" />
  120. <div class="container">
  121. <div class="slide-caption">
  122. <h2><?php _e('Graphic design','busiprof'); ?></h2>
  123. <p><?php _e('We are a group of passionate designers and developers who love to create awesome WordPress themes with an amazing support and the coolest video documentation.','busiprof'); ?></p>
  124. <div><a href="#" class="flex-btn"><?php _e('Read More','busiprof'); ?></a></div>
  125. </div>
  126. </div>
  127. </li>
  128. <li>
  129. <img alt="img" src="<?php echo get_template_directory_uri(); ?>/images/slide3.jpg" />
  130. <div class="container">
  131. <div class="slide-caption">
  132. <h2><?php _e('User friendly','busiprof'); ?></h2>
  133. <p><?php _e('We are a group of passionate designers and developers who love to create awesome WordPress themes with an amazing support and the coolest video documentation.','busiprof'); ?></p>
  134. <div><a href="#" class="flex-btn"><?php _e('Read More','busiprof'); ?></a></div>
  135. </div>
  136. </div>
  137. </li>
  138. <?php } ?>
  139. </ul>
  140. </div>
  141. </section>
  142. </div>
  143. <!-- End of Slider -->
  144.  
  145. <div class="clearfix"></div>
  146. <?php
  147. if( $current_options['home_banner_strip_enabled'] == 'on' && $current_options['intro_tag_line'] != '' ) { ?>
  148.  
  149. <section class="header-title"><h2><?php echo $current_options['intro_tag_line']; ?> </h2></section>
  150. <div class="clearfix"></div>
  151. <?php }
  152. } ?>
Add Comment
Please, Sign In to add comment