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( 'tc_slide_title_length', 'my_slider_text_limits' );
add_filter( 'tc_slide_text_length', 'my_slider_text_limits' );
add_filter( 'tc_slide_button_length', 'my_slider_text_limits' );
function my_slider_text_limits() {
    switch ( current_filter() ) {
        case 'tc_slide_title_length':
            return 150;
            break;
        
        case 'tc_slide_text_length':
            return 500;
            break;

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

N.B.

When using the slider of posts the filters are, instead:

tc_post_slide_title_length
tc_post_slide_text_length
tc_posts_slider_button_text_length

 

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.