- This topic has 3 replies, 2 voices, and was last updated 10 years, 8 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
These forums are now closed and remain for historical purposes.
None of the content applies to the new version 3. For support, get in touch via our contact form.
Forums › Forums › Search & Filter Pro › limit experpt length
Please take a look at the WordPress codex entry for this function and correct usage:
https://codex.wordpress.org/Function_Reference/the_excerpt#Control_Excerpt_Length_using_Filters
I can already see the bit of code you want is there:
function custom_excerpt_length( $length ) {
return 20;
}
add_filter( ‘excerpt_length’, ‘custom_excerpt_length’, 999 );
In addition, I believe the_excerpt() echos the output immediately- so substr won’t work as its not placed inside a variable.
Thanks