Adjust excerpt length in WordPress

Categories: CMS, PHP, Programming & Scripting, Wordpress

Add this to functions.php to achieve it:

function mytheme_custom_excerpt_length( $length ) {
return 20;
}
add_filter( 'excerpt_length', 'mytheme_custom_excerpt_length', 999 );

Default is 55 words, this reduces it to 20 words which is great for themes/posts like those on nano.cat.

References:

«
»