catchresponsive_featured_slider

Add slider.

Description

catchresponsive_featured_slider(); 

Usage

  1. if ( !function_exists( 'catchresponsive_featured_slider' ) ) { 
  2. require_once '/inc/catchresponsive-featured-slider.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = catchresponsive_featured_slider(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/inc/catchresponsive-featured-slider.php  
  1. function catchresponsive_featured_slider() { 
  2. global $post, $wp_query; 
  3. //catchresponsive_flush_transients(); 
  4. // get data value from options 
  5. $enableslider = $options['featured_slider_option']; 
  6. $sliderselect = $options['featured_slider_type']; 
  7. $imageloader = isset ( $options['featured_slider_image_loader'] ) ? $options['featured_slider_image_loader'] : 'true'; 
  8.  
  9. // Get Page ID outside Loop 
  10. $page_id = $wp_query->get_queried_object_id(); 
  11.  
  12. // Front page displays in Reading Settings 
  13. $page_on_front = get_option('page_on_front') ; 
  14. $page_for_posts = get_option('page_for_posts'); 
  15.  
  16. if ( 'entire-site' == $enableslider || ( ( is_front_page() || ( is_home() && $page_for_posts != $page_id ) ) && 'homepage' == $enableslider ) ) { 
  17. if ( ( !$catchresponsive_featured_slider = get_transient( 'catchresponsive_featured_slider' ) ) ) { 
  18. echo '<!-- refreshing cache -->'; 
  19.  
  20. $catchresponsive_featured_slider = ' 
  21. <section id="feature-slider"> 
  22. <div class="wrapper"> 
  23. <div class="cycle-slideshow" 
  24. data-cycle-log="false" 
  25. data-cycle-pause-on-hover="true" 
  26. data-cycle-swipe="true" 
  27. data-cycle-auto-height=container 
  28. data-cycle-fx="'. esc_attr( $options['featured_slide_transition_effect'] ) .'" 
  29. data-cycle-speed="'. esc_attr( $options['featured_slide_transition_length'] ) * 1000 .'" 
  30. data-cycle-timeout="'. esc_attr( $options['featured_slide_transition_delay'] ) * 1000 .'" 
  31. data-cycle-loader="'. esc_attr( $imageloader ) .'" 
  32. data-cycle-slides="> article" 
  33.  
  34. <!-- prev/next links --> 
  35. <div class="cycle-prev"></div> 
  36. <div class="cycle-next"></div> 
  37.  
  38. <!-- empty element for pager links --> 
  39. <div class="cycle-pager"></div>'; 
  40.  
  41. // Select Slider 
  42. if ( 'demo-featured-slider' == $sliderselect && function_exists( 'catchresponsive_demo_slider' ) ) { 
  43. $catchresponsive_featured_slider .= catchresponsive_demo_slider( $options ); 
  44. elseif ( 'featured-page-slider' == $sliderselect && function_exists( 'catchresponsive_page_slider' ) ) { 
  45. $catchresponsive_featured_slider .= catchresponsive_page_slider( $options ); 
  46.  
  47. $catchresponsive_featured_slider .= ' 
  48. </div><!-- .cycle-slideshow --> 
  49. </div><!-- .wrapper --> 
  50. </section><!-- #feature-slider -->'; 
  51.  
  52. set_transient( 'catchresponsive_featured_slider', $catchresponsive_featured_slider, 86940 ); 
  53. echo $catchresponsive_featured_slider;