• I am trying to limit the character count on a post/page. I have added maxlenght to the title and that works for all browsers except for Chrome. Any ideas on how to get chrome to limit the character count?

    • This topic was modified 2 years, 8 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
Viewing 2 replies - 1 through 2 (of 2 total)
  • you would have to use a filter in the functions.php file something like this :

    function max_title_length( $title ) {
    $max = 20;

    if ( strlen( $title ) > $max ) {
    return substr( $title, 0, $max ) . ‘ …’;
    } else {
    return $title;
    }
    }
    add_filter( ‘the_title’, ‘max_title_length’ );

    Thread Starter WebbleWabble

    (@webblewabble)

    @mrtom414 I am trying to limit the post url and the title on the backend for a post or page. I should have explained that better. Any ideas on that?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Limit Gutenberg Page/Post title charactures’ is closed to new replies.