Site logo

Archived topic

Customize Category Archive and Blog Post page separately

5 replies · Started by Victoria on September 13, 2020

Viewing posts 1–6 of 6

Okay, that makes sense. Yes, I'd love some help with the code, please! I'd like to get my category page 'DIY Projects' to be 2 columns, in a masonry grid, with 'read more' buttons. If it's possible I'd like the first post to be featured. Thanks for helping a newbie like me!

Try this PHP snippet:

add_filter( 'generate_blog_get_column_count', function( $count ) {
    if ( is_category( 'diy-projects'  ) {
        return '50';
    }

    return $count;
} );

add_filter( 'option_generate_blog_settings', function( $options ) {
    if ( is_category( 'diy-projects' ) ) {
        $options['column_layout'] = true;
        $options['featured_column'] = true;
        $options['masonry'] = true;
    }

    return $options;
} );

Adding PHP: https://docs.generatepress.com/article/adding-php/

The read more buttons should still apply as I see them on the Blog page as well.

Let me know if this helps :)

That was perfect. Thanks so much!

No problem :)

This archived topic is closed to new replies.