Guest User

Untitled

a guest
Nov 12th, 2018
27
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $slide_options = get_theme_mod('busiprof_slider_content');
  3. if(empty($slide_options))
  4. {
  5. $lite_slider_data = get_option('busiprof_theme_options');
  6. $pro_slider_data = get_option('busiprof_pro_theme_options');
  7. if(!empty($pro_slider_data))
  8. {
  9. $args = array( 'post_type' => 'busiprof_slider') ;
  10. $slider = new WP_Query( $args );
  11. if( $slider->have_posts() )
  12. {
  13. while ( $slider->have_posts() ) : $slider->the_post();
  14. $pro_slider_data_old[] = array(
  15. 'title' => get_the_title(),
  16. 'text' => sanitize_text_field( get_post_meta( get_the_ID(),'image_description', true )),
  17. 'button_text' => sanitize_text_field( get_post_meta( get_the_ID(),'readmore_button', true )),
  18. 'link' => sanitize_text_field( get_post_meta( get_the_ID(),'readmore_link', true )),
  19. 'image_url' => get_the_post_thumbnail_url(),
  20. 'open_new_tab' => isset($data['readmore_target'])? $data['readmore_target'] : false,
  21. 'id' => 'customizer_repeater_56d7ea7f40b50',
  22. );
  23. endwhile;
  24. $slide_options = json_encode($pro_slider_data_old);
  25. }
  26. }elseif(!empty($lite_slider_data))
  27. {
  28. $slide_options = json_encode( array(
  29. array(
  30. 'title' => isset($lite_slider_data['caption_head'])? $lite_slider_data['caption_head']:'Responsive WP theme',
  31. '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.',
  32. 'button_text' => isset($lite_slider_data['readmore_text'])? $lite_slider_data['readmore_text'] : 'Read more',
  33. 'link' => isset($lite_slider_data['readmore_text_link'])? $lite_slider_data['readmore_text_link'] : '#',
  34. 'image_url' => isset($lite_slider_data['slider_image'])? $lite_slider_data['slider_image'] : get_template_directory_uri().'/images/slide1.jpg',
  35. 'open_new_tab' => isset($lite_slider_data['readmore_target'])? $lite_slider_data['readmore_target'] : false,
  36. 'id' => 'customizer_repeater_56d7ea7f40b50',
  37. ),
  38. ) );
  39. }
  40. }
  41.  
  42. $current_options = wp_parse_args( get_option( 'busiprof_pro_theme_options', array() ), theme_data_setup() );
  43.  
  44. ?>
  45.  
  46.  
  47. <script type="text/javascript">
  48. // Flexslider custom js here
  49. jQuery(document).ready(function(){
  50. //Hompage Slider Js
  51. jQuery('#slider2').flexslider({
  52. animation: "<?php echo $current_options['animation']; ?>",
  53. slideshowSpeed: "<?php echo $current_options['slideshow_speed']; ?>",
  54. direction: "<?php echo $current_options['slide_direction']; ?>",
  55. animationSpeed: "<?php echo $current_options['animation_speed']; ?>",
  56. controlNav: false,
  57. animationLoop: true,
  58. pauseOnHover: true,
  59. slideshow: true,
  60. sync: "#carousel",
  61. after: function (slider2) {
  62. if (!slider2.playing) {
  63. slider2.play();
  64. }
  65. }
  66.  
  67. });
  68. });
  69. </script>
  70.  
  71. <div class="clearfix"></div>
  72.  
  73. <!-- Slider -->
  74. <?php if( $current_options['home_page_slider_enabled'] == 'on' ) { ?>
  75. <div id="main" role="main">
  76. <section class="slider">
  77. <div id="slider2" class="flexslider">
  78. <ul class="slides">
  79. <?php
  80. $slide_options = json_decode($slide_options);
  81. if( $slide_options!='' )
  82. {
  83. foreach($slide_options as $slide_iteam){?>
  84. <li >
  85. <?php if($slide_iteam->image_url!=''){ ?>
  86. <img alt="img" class="img-responsive" src="<?php echo $slide_iteam->image_url; ?>" draggable="false">
  87.  
  88. <?php
  89. }
  90.  
  91. $title = ! empty( $slide_iteam->title ) ? apply_filters( 'busiprof_translate_single_string', $slide_iteam->title, 'Slider section' ) : '';
  92. $img_description = ! empty( $slide_iteam->text ) ? apply_filters( 'busiprof_translate_single_string', $slide_iteam->text, 'Slider section' ) : '';
  93. $readmorelink = ! empty( $slide_iteam->link ) ? apply_filters( 'busiprof_translate_single_string', $slide_iteam->link, 'Slider section' ) : '';
  94. $readmore_button = ! empty( $slide_iteam->button_text ) ? apply_filters( 'busiprof_translate_single_string', $slide_iteam->button_text, 'Slider section' ) : '';
  95. $open_new_tab = $slide_iteam->open_new_tab;
  96. ?>
  97. <div class="container">
  98. <div class="slide-caption">
  99. <?php if($title!= '') { ?>
  100. <h2><?php echo $title; ?></h2>
  101. <?php }
  102. if($img_description!= '') {?>
  103. <p><?php echo $img_description ;?></p>
  104. <?php }?>
  105. <div>
  106. <?php if($readmore_button!='' ) { ?>
  107. <a href="<?php echo $readmorelink ;?>" <?php if($open_new_tab== 'yes') { echo "target='_blank'"; } ?> class="flex-btn">
  108. <?php echo $readmore_button ?>
  109. </a>
  110. <?php } ?>
  111. </div>
  112. </div>
  113. </div>
  114. </li>
  115. <?php }
  116. } else { ?>
  117. <li >
  118. <img alt="img" src="<?php echo get_template_directory_uri(); ?>/images/slide1.jpg" />
  119. <div class="container">
  120. <div class="slide-caption">
  121. <h2><?php _e('Responsive WP theme','busiprof'); ?></h2>
  122. <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>
  123. <div><a href="#" class="flex-btn"><?php _e('Read More','busiprof'); ?></a></div>
  124. </div>
  125. </div>
  126. </li>
  127. <li>
  128. <img alt="img" src="<?php echo get_template_directory_uri(); ?>/images/slide2.jpg" />
  129. <div class="container">
  130. <div class="slide-caption">
  131. <h2><?php _e('Graphic design','busiprof'); ?></h2>
  132. <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>
  133. <div><a href="#" class="flex-btn"><?php _e('Read More','busiprof'); ?></a></div>
  134. </div>
  135. </div>
  136. </li>
  137. <li>
  138. <img alt="img" src="<?php echo get_template_directory_uri(); ?>/images/slide3.jpg" />
  139. <div class="container">
  140. <div class="slide-caption">
  141. <h2><?php _e('User friendly','busiprof'); ?></h2>
  142. <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>
  143. <div><a href="#" class="flex-btn"><?php _e('Read More','busiprof'); ?></a></div>
  144. </div>
  145. </div>
  146. </li>
  147. <?php } ?>
  148. </ul>
  149. </div>
  150. </section>
  151. </div>
  152. <!-- End of Slider -->
  153.  
  154. <div class="clearfix"></div>
  155. <?php
  156. if( $current_options['home_banner_strip_enabled'] == 'on' && $current_options['intro_tag_line'] != '' ) { ?>
  157.  
  158. <section class="header-title"><h2><?php echo $current_options['intro_tag_line']; ?> </h2></section>
  159. <div class="clearfix"></div>
  160. <?php }
  161. } ?>
RAW Paste Data