Guest User

Untitled

a guest
Nov 29th, 2018
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.37 KB | None | 0 0
  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. require( BUSI_THEME_FUNCTIONS_PATH . '/scripts/indexslider-script.php' );
  44. ?>
  45. <div class="clearfix"></div>
  46.  
  47. <!-- Slider -->
  48. <?php if( $current_options['home_page_slider_enabled'] == 'on' ) { ?>
  49. <div id="main" role="main">
  50. <section class="slider">
  51. <div id="slider" class="flexslider">
  52. <ul class="slides">
  53. <?php
  54. $slide_options = json_decode($slide_options);
  55. if( $slide_options!='' )
  56. {
  57. foreach($slide_options as $slide_iteam){
  58. $title = ! empty( $slide_iteam->title ) ? apply_filters( 'busiprof_translate_single_string', $slide_iteam->title, 'Slider section' ) : '';
  59. $img_description = ! empty( $slide_iteam->text ) ? apply_filters( 'busiprof_translate_single_string', $slide_iteam->text, 'Slider section' ) : '';
  60. $readmorelink = ! empty( $slide_iteam->link ) ? apply_filters( 'busiprof_translate_single_string', $slide_iteam->link, 'Slider section' ) : '';
  61. $readmore_button = ! empty( $slide_iteam->button_text ) ? apply_filters( 'busiprof_translate_single_string', $slide_iteam->button_text, 'Slider section' ) : '';
  62. $open_new_tab = $slide_iteam->open_new_tab;
  63.  
  64. ?>
  65.  
  66.  
  67. <a href="<?php echo $readmorelink ;?>" <?php if($open_new_tab== 'yes') { echo "target='_blank'"; } ?> class="">
  68. <li>
  69. <?php if($slide_iteam->image_url!=''){ ?>
  70. <img alt="img" class="img-responsive" src="<?php echo $slide_iteam->image_url; ?>" draggable="false">
  71.  
  72. <?php
  73. }
  74.  
  75.  
  76. ?>
  77. <div class="container">
  78. <div class="slide-caption">
  79. <?php if($title!= '') { ?>
  80. <h2><?php echo $title; ?></h2>
  81. <?php }
  82. if($img_description!= '') {?>
  83. <p><?php echo $img_description ;?></p>
  84. <?php }?>
  85. <div>
  86. <?php if($readmore_button!='' ) { ?>
  87. <a href="<?php echo $readmorelink ;?>" <?php if($open_new_tab== 'yes') { echo "target='_blank'"; } ?> class="flex-btn">
  88. <?php echo $readmore_button ?>
  89. </a>
  90. <?php } ?>
  91. </div>
  92. </div>
  93. </div>
  94. </li>
  95. </a>
  96. <?php }
  97. } else { ?>
  98. <li>
  99. <img alt="img" src="<?php echo get_template_directory_uri(); ?>/images/slide1.jpg" />
  100. <div class="container">
  101. <div class="slide-caption">
  102. <h2><?php _e('Responsive WP theme','busiprof'); ?></h2>
  103. <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>
  104. <div><a href="#" class="flex-btn"><?php _e('Read More','busiprof'); ?></a></div>
  105. </div>
  106. </div>
  107. </li>
  108. <li>
  109. <img alt="img" src="<?php echo get_template_directory_uri(); ?>/images/slide2.jpg" />
  110. <div class="container">
  111. <div class="slide-caption">
  112. <h2><?php _e('Graphic design','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/slide3.jpg" />
  120. <div class="container">
  121. <div class="slide-caption">
  122. <h2><?php _e('User friendly','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. <?php } ?>
  129. </ul>
  130. </div>
  131. </section>
  132. </div>
  133. <!-- End of Slider -->
  134.  
  135. <div class="clearfix"></div>
  136. <?php
  137. if( $current_options['home_banner_strip_enabled'] == 'on' && $current_options['intro_tag_line'] != '' ) { ?>
  138.  
  139. <section class="header-title"><h2><?php echo $current_options['intro_tag_line']; ?> </h2></section>
  140. <div class="clearfix"></div>
  141. <?php }
  142. } ?>
Add Comment
Please, Sign In to add comment