Archived topic
Reduce length of excerpt on Category / Archive Pages
3 replies · Started by antware on August 10, 2020
Hi guys, looking to reduce the excerpt length when list of posts are listed on a category archive page.
This is what I'm currently using in the function.php file, but it's having no effect:
function archive_custom_excerpt_length( $length ) {
if ( is_category() ) {
return 25;
}
return $length;
}
add_filter( 'excerpt_length', 'archive_custom_excerpt_length', 99 );
Any ideas would be great, thanks.
Hi there,
The code looks good to me. Not sure why it isn't working.
Can you give this a shot instead?
https://docs.generatepress.com/article/excerpt_length/
Thanks Leo, it seemed I missed something, and it was in fact working.
Any idea how to increase or reduce the number of posts that would appear on a Category Archive page, currently set to 10, I only want 9 as I have a 3 column grid?
Any chance you can open a new topic for the separate question?
I'll mark this as resolved.
Thanks :)