Skip to main content

Length of Post Excerpt

Comments

4 comments

  • Official comment
    Chris Bernecker

    Took me a while to figue what you meant...

    You can limit the length of the excerpt in WP, thats no a brizy thing, Usually it's set to 55 characters, but you can narrow it down, just add this code into your themes function php:

    that would limit the length to 20 characters. if you want more - just change the 20 in th 2nd line with whatever you want :)

    function custom_excerpt_length( $length ) {
    	return 20;
    }
    add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
  • Ramon Hein

    Works like a charm. Thanks a lot! Next time I will try to be more specific with my description. :) 

    1
  • Adam Newbold

    Thank you @chris bernecker. I used the code successfully. On my page, though, the number reflects the word count, not the character count. Just something for others to consider if they're seeing this later on. Thanks again!

    0
  • Hock Teo

    Thanks. I figured out using "Insert Read More Tag" in the post itself will have a better control on how I want the excerpt to end.

    0

Please sign in to leave a comment.