Site logo

Archived topic

Question about Category Page Layouts

18 replies · Started by Karen on March 5, 2020

Viewing posts 1–15 of 19

Hi there,

I was wondering if it was possible to set up category pages to display posts in a grid format with the featured image. I only wanted this on category pages and not my home/archive page of posts. I understand that there is WP show it plugin, but I didn't want to have to add new pages to display this.

Thanks so much for any help you can provide,

Karen

Hi there,

Just to confirm, so you want to hide the post title, excerpt and read more on category pages?

Let me know :)

Hi Leo,

I don't want to hide the post title, but I do want to hide the excerpt and read more on the category pages. If it's possible to set it up where it can show two posts side by side on mobile, that would be great. Thanks so much for the quick response!

Karen

If it helps, this is kind of what I was thinking ... https://www.mapleandmango.com/food/

If you look at this website on a mobile device, you can see two featured images side by side.

Thanks again,

karen

Thanks so much. It did take away the summary on the category pages, but they are still showing as single blog posts instead of a column type grid.

Thanks again for your help though. I can try and play around with this.

So is the issue solved now?

I'm happy to help more if you need :)

It's not solved. Thanks for trying to help. The blog posts on the category page still show as single posts, instead of side by side grid type format. Any other code I could try? Is it possible to put wp show it posts shortcode on category pages?

Ok, I was playing around with this a little bit. I set up columns for pages in the customize tab. Is there any way to have the homepage (which is just an archive list of my posts) show the posts NOT in columns?

So basically, I wanted columns for the category pages and NO columns for the homepage archive.

Thanks!

karen

Hi Leo,

Yes, I added the PHP via Code Snippets. But the columns are still not showing up on the category archive pages? Not sure what I'm doing wrong?

Is the code added currently?

Did you clear and disable WP Rockets after adding it first?

I didn't disable WP Rocket, but I cleared the cache afterwards. Do I need to disable it first?

And yes, the code is added currently.

We just always ask to turn the caching plugins off so we can inspect the code better:
https://www.screencast.com/t/O3NDJ5fyH0N

I think I found the issue though.

Try adding these two snippets together instead:

add_filter( 'generate_blog_columns', function( $columns ) {
    if ( is_category( ) ) {
        return true;
    }

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

    return $count;
} );

and make sure the Blog module is activated here:
https://docs.generatepress.com/article/installing-gp-premium/#activate-your-modules

This archived topic is closed to new replies.