onetone_get_default_slider

The Onetone onetone get default slider function.

Description

onetone_get_default_slider(); 

Usage

  1. if ( !function_exists( 'onetone_get_default_slider' ) ) { 
  2. require_once '/includes/theme-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = onetone_get_default_slider(); 
  7.  

Defined (1)

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

/includes/theme-functions.php  
  1. function onetone_get_default_slider() { 
  2.  
  3. $sanitize_title = "home"; 
  4. $section_menu = onetone_option( 'menu_title_0' ); 
  5. $section_slug = onetone_option( 'menu_slug_0' ); 
  6. if( $section_menu != "" ) { 
  7. $sanitize_title = sanitize_title($section_menu ); 
  8. if( trim($section_slug) !="" ) { 
  9. $sanitize_title = sanitize_title($section_slug);  
  10.  
  11.  
  12.  
  13. $return = '<section id="'.$sanitize_title.'" class="section homepage-slider onetone-'.$sanitize_title.'"><div id="onetone-owl-slider" class="owl-carousel owl-theme">'; 
  14. for($i=1;$i<=5;$i++) { 
  15. $active = ''; 
  16.  
  17. $text = onetone_option('onetone_slide_text_'.$i); 
  18. $image = onetone_option('onetone_slide_image_'.$i); 
  19.  
  20. if( $image != "" ) { 
  21. $return .= '<div class="item"><img src="'.$image.'" alt=""><div class="inner">'. do_shortcode($text) .'</div></div>'; 
  22.  
  23.  
  24.  
  25.  
  26. $return .= '</div></section>'; 
  27.  
  28. return $return;