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.  
  7. if( $section_menu != "" ) { 
  8.  
  9. $sanitize_title = sanitize_title($section_menu ); 
  10.  
  11. if( trim($section_slug) !="" ) { 
  12.  
  13. $sanitize_title = sanitize_title($section_slug);  
  14.  
  15. }  
  16.  
  17. $return = '<section id="'.$sanitize_title.'" class="section homepage-slider onetone-'.$sanitize_title.'"><div id="onetone-owl-slider" class="owl-carousel">'; 
  18.  
  19. for($i=1;$i<=10;$i++) { 
  20. $active = ''; 
  21. $text = onetone_option('onetone_slide_text_'.$i); 
  22. $image = onetone_option('onetone_slide_image_'.$i); 
  23. $btn_txt = onetone_option('onetone_slide_btn_txt_'.$i); 
  24. $btn_link = onetone_option('onetone_slide_btn_link_'.$i); 
  25. $btn_target = onetone_option('onetone_slide_btn_target_'.$i); 
  26.  
  27. $btn_str = ''; 
  28.  
  29. if( $btn_txt != '' ) { 
  30.  
  31. $btn_str = '<br/><a class="btn" target="'.esc_attr($btn_target).'" href="'.esc_url($btn_link).'">'.do_shortcode($btn_txt).'</a>'; 
  32.  
  33.  
  34. if( trim($image) != "" ) { 
  35. $return .= '<div class="item"><img src="'.esc_url($image).'" alt=""><div class="inner"><div class="caption"><div class="caption-inner">'. do_shortcode($text) .$btn_str.'</div></div></div></div>'; 
  36. }  
  37.  
  38.  
  39. $return .= '</div></section>'; 
  40.  
  41. return $return; 
  42.