You will need to use a custom function to control the amount of words in an excerpt.
Something like this might work:
function custom_excerpt_length($length) {
return 300; // Change this word count to whatever you want.
}
add_filter('excerpt_length', 'custom_excerpt_length', 20 );
Where should I put it in? I have tried putting it into custom_functions.php and it doesn’t work. Any suggestions ?
Are you using a child theme? Ideally, you want to add it to your child theme functions.php
file.
If you aren’t using a child theme… shame on you!! But.. you can add it to your theme’s functions.php
file. You’ll just have to redo it anytime you update your theme.
Josh,I am using thesis theme,dont know if this is child theme,but to me it looks like parent. Also tried uploading it to the functions.php,can’t get that to work.
Okay, try this one:
function custom_excerpt_length( $length ) {
return 300;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
Add it to the end of your themes functions.php file. But make sure it’s pasted BEFORE the closing ?>
at the bottom of the file.