Changing the default length / limits of the slider texts

With the following snippet, you can take control of the various slider texts length in the Customizr theme :

  • title (default 80 chars),
  • lead text under the title  (default 250 chars),
  • button text  (default 80 chars).

 

add_filter( 'czr_slide_title_length', 'my_slider_text_limits' );
add_filter( 'czr_slide_text_length', 'my_slider_text_limits' );
add_filter( 'czr_slide_button_length', 'my_slider_text_limits' );
function my_slider_text_limits() {
    switch ( current_filter() ) {
        case 'czr_slide_title_length':
            return 150;
            break;
        
        case 'czr_slide_text_length':
            return 500;
            break;

        case 'czr_slide_button_length':
             return 150;
            break;
    }
}

Where to copy/paste this code? => in your functions.php file. We strongly recommend you create a child theme. Download a start-up child theme here.

Remember: you shouldn’t edit the theme’s functions.php.

13 thoughts on “Changing the default length / limits of the slider texts”

Comments are closed.