Archived topic
Different Lay-outs for categories
11 replies · Started by Arno on August 18, 2022
Hi, I want different layouts for categories.
I want 2 columns for the main blog page and 1 column for the other.
How do I do that?
Hi Arno,
You’ll need a filter.
Reference: https://docs.generatepress.com/article/using-columns-in-the-blog/#changing-the-number-of-columns
Example:
add_filter( 'generate_blog_get_column_count','tu_search_column_count' );
function tu_search_column_count( $count ) {
if ( is_category() ) {
return 100;
}
return $count;
}
Then set the blog column to 2 in the customizer.
Thanks !
You’re welcome Arno!
I have set in the customizer for the main blog page the first post featured. I don't want that for the other category's pages. How do i do that? using a filter.
Main blog page: https://arnoschouten.net/roze50plusnl/nieuws/
catagory page: https://arnoschouten.net/roze50plusnl/category/ambassadeurs/
To clarify, are you referring to removing the featured image on category archive pages?
no, there is an option in the customizer layout for blog: Make first post featured. that is what i want for the main blog page but not for the other catagory pages.
Main blog page: https://arnoschouten.net/roze50plusnl/nieuws/
catagory page: https://arnoschouten.net/roze50plusnl/category/ambassadeurs/
I see. You can try Leo’s response here: https://generatepress.com/forums/topic/only-show-post-as-featured-post-on-homepage/#post-680362
thanks al lot! it works.
is there an archive on fliters? the are handy!
Hi there,
see here:
https://docs.generatepress.com/collection/filters/
Its all of the ones we have docs for....
Thanks!
You're welcome