Custom excerpt length filter doesn’t work

So I’m trying to change the standard post excerpt length.

Every single blog post on the web tells me to do it with a filter like this:

add_filter( ‘excerpt_length’, ‘custom_excerpt_length’, 999 );
function custom_excerpt_length( $length ) {
return 15; // Length of the excerpt in number of words
}

Problem is there is no change to the excerpt length. All the text is being output and not just 15 words. I have no idea why this doesn’t work when it’s supposed to be the solution.

I’m using in the post loop on home.php, category.php and tag.php to output the excerpt.

Read more here:: Custom excerpt length filter doesn’t work

Leave a Reply

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