Reputation: 23
I have tried using this code to reduce the length of the search results in Wordpress but it doesn't seem to make any difference. It basically posts the full page as a search result rather than just part of the page.
function custom_excerpt_length( $length ) {
if (is_search()) {
return 200;
}
else{
return $length;
}
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
I am using the plugin 'Ivory Search' which uses the standard wordpress search result function. Any help would be appreciated.
Upvotes: 0
Views: 26