Black Friday Sale! Get $20 off GP Premium, $40 off our new Lifetime license, and 45% off license renewals/extensions! Learn more

Show Excerpts Only on Category Pages

Home Forums Support Show Excerpts Only on Category Pages

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #171695
    Isi

    Hello Tom,

    I would like to know how can I change the Generatepress-theme, that it only shows excerpts on category pages.

    Also I have read that the standard WordPress excerpt only contains 55 words. How to change that so more words are displayed and pictures and also a “read more”-link.

    Thank you in advance.

    Kind regards,
    Ismar

    #171706
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    First, go to “Customize > Blog > Blog Content” and set it to show full posts.

    Then you can add this PHP to make it show an excerpt within categories:

    add_filter( 'generate_show_excerpt','generate_show_excerpt_categories' );
    function generate_show_excerpt_categories( $show_excerpt )
    {
        if ( is_category() ) {
            return true;
        }
    
        return $show_excerpt;
    }

    Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/

    If you have the Blog add-on you can change the excerpt length in “Customize > Blog > Blog Content”.

    Let me know 🙂

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