Snippet: Change length of the excerpt

You can limit the number of characters of excerpt to display on page.

Add following code to “functions.php”

Snippet

// It will change the length of excerpt to 100 characters
add_filter('excerpt_length', 'new_excerpt_length');
function new_excerpt_length($length) { 
    return 100;
}

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>