Code WordPress

WordPress: Change the Excerpt Length

Alter the character word of the excerpts on your WordPress blog.

The following can be added to your theme’s functions.php to alter the excerpt word count.

//Filter the excerpt
function new_excerpt_length($length) {
 return 20;
add_filter('excerpt_length', 'new_excerpt_length');

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.