How to change the number of words in the WordPress Twenty Twelve theme summary

You can add these lines within your functions.php. I recommend that you create a child theme for WordPress before adding code. Themes are up to date and you would lose changes differently.

Place this code at the end of the file, remember that in this example the number 20 represents the maximum number of words that can be included in the summary.

function twentytwelve_excerpt_legth( $length ) {
return 20;
add_filter( 'excerpt_length','twentytwelve_excerpt_length' );

To get the best result, you should test. Normally 20 words for a summary are few. If you have any problems with my guide or it is unclear, please leave a comment and I will respond as soon as possible.


Your email address will not be published.