Guest User

Untitled

a guest
Oct 15th, 2018
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.31 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. <li>
  59. <?php if($slide_iteam->image_url!=''){ ?>
  60. <img alt="img" class="img-responsive" src="<?php echo $slide_iteam->image_url; ?>" draggable="false">
  61.  
  62. <?php
  63. }
  64.  
  65. $title = ! empty( $slide_iteam->title ) ? apply_filters( 'busiprof_translate_single_string', $slide_iteam->title, 'Slider section' ) : '';
  66. $img_description = ! empty( $slide_iteam->text ) ? apply_filters( 'busiprof_translate_single_string', $slide_iteam->text, 'Slider section' ) : '';
  67. $readmorelink = ! empty( $slide_iteam->link ) ? apply_filters( 'busiprof_translate_single_string', $slide_iteam->link, 'Slider section' ) : '';
  68. $readmore_button = ! empty( $slide_iteam->button_text ) ? apply_filters( 'busiprof_translate_single_string', $slide_iteam->button_text, 'Slider section' ) : '';
  69. $open_new_tab = $slide_iteam->open_new_tab;
  70. ?>
  71. <?php if($title!= '' || $img_description!= '' || $readmore_button!='') { ?>
  72. <div class="container">
  73. <div class="slide-caption">
  74. <?php if($title!= '') { ?>
  75. <h2><?php echo $title; ?></h2>
  76. <?php }
  77. if($img_description!= '') {?>
  78. <p><?php echo $img_description ;?></p>
  79. <?php }?>
  80. <div>
  81. <?php if($readmore_button!='' ) { ?>
  82. <a href="<?php echo $readmorelink ;?>" <?php if($open_new_tab== 'yes') { echo "target='_blank'"; } ?> class="flex-btn">
  83. <?php echo $readmore_button ?>
  84. </a>
  85. <?php } ?>
  86. </div>
  87. </div>
  88. </div>
  89. <?php } ?>
  90. </li>
  91. <?php }
  92. } else { ?>
  93. <li>
  94. <img alt="img" src="<?php echo get_template_directory_uri(); ?>/images/slide1.jpg" />
  95. <div class="container">
  96. <div class="slide-caption">
  97. <h2><?php _e('Responsive WP theme','busiprof'); ?></h2>
  98. <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>
  99. <div><a href="#" class="flex-btn"><?php _e('Read More','busiprof'); ?></a></div>
  100. </div>
  101. </div>
  102. </li>
  103. <li>
  104. <img alt="img" src="<?php echo get_template_directory_uri(); ?>/images/slide2.jpg" />
  105. <div class="container">
  106. <div class="slide-caption">
  107. <h2><?php _e('Graphic design','busiprof'); ?></h2>
  108. <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>
  109. <div><a href="#" class="flex-btn"><?php _e('Read More','busiprof'); ?></a></div>
  110. </div>
  111. </div>
  112. </li>
  113. <li>
  114. <img alt="img" src="<?php echo get_template_directory_uri(); ?>/images/slide3.jpg" />
  115. <div class="container">
  116. <div class="slide-caption">
  117. <h2><?php _e('User friendly','busiprof'); ?></h2>
  118. <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>
  119. <div><a href="#" class="flex-btn"><?php _e('Read More','busiprof'); ?></a></div>
  120. </div>
  121. </div>
  122. </li>
  123. <?php } ?>
  124. </ul>
  125. </div>
  126. </section>
  127. </div>
  128. <!-- End of Slider -->
  129.  
  130. <div class="clearfix"></div>
  131. <?php
  132. if( $current_options['home_banner_strip_enabled'] == 'on' && $current_options['intro_tag_line'] != '' ) { ?>
  133.  
  134. <section class="header-title"><h2><?php echo $current_options['intro_tag_line']; ?> </h2></section>
  135. <div class="clearfix"></div>
  136. <?php }
  137. } ?>
Add Comment
Please, Sign In to add comment