This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Reply To: Truncate post list excerpt in child theme

Jason Bobich


This wouldn’t have anything to do with the theme specifically. If you track back in WordPress core searching with your text editor from the_excerpt function, you’ll find the root of the except formatting comes from a function called wp_trim_excerpt.

Then, inside we can see that there is a filter on the length of the excerpt called “excerpt_length” we can use.

function my_excerpt_length( $length ) {
	return 20; // # of words, default is 55.
add_filter( 'excerpt_length', 'my_excerpt_length' );

This is actually a good article about how to find the source of the excerpt and just how to tackle finding these things for yourself, but it looks like it was written before someone though to just add on a filter to length of excerpts.