WordPress Function to Function to change the length of Exerpt

Function to change the length of Exerpt

Tested on: WordPress 3.0.1

By default all excerpts are capped at 55 words. Utilizing the code below you can override this default settings:

function new_excerpt_length($length) { 
    return 100;
}

add_filter('excerpt_length', 'new_excerpt_length');

This example changes the excerpt length to 100 words, but you can use the same method to change it to any value.

You may also like...

Leave a Reply

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