[Resolved] Reduce length of excerpt on Category / Archive Pages

Home Forums Support Reduce length of excerpt on Category / Archive Pages

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1395778
    antware

    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.

    #1395795
    Leo
    Staff
    Customer Support

    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/

    #1396220
    antware

    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?

    #1396235
    Leo
    Staff
    Customer Support

    Any chance you can open a new topic for the separate question?

    I’ll mark this as resolved.

    Thanks 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.