Site logo

Archived topic

Show Excerpts Only on Category Pages

1 reply · Started by Isi on February 9, 2016

Viewing posts 1–2 of 2

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

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 :)

This archived topic is closed to new replies.