Site logo

Archived topic

Category page in columns

1 reply · Started by Jee on April 22, 2020

Viewing posts 1–2 of 2

I want to set the homepage to be 1 column and page title above the photo but have the categories pages to have 2 columns and page title under the photo. What would be the code for this?

Thanks!

Hi there,

you can use the Blog Options filter to do that:

https://docs.generatepress.com/article/option_generate_blog_settings/

So for example you could use the Customizer to create the layout for your Categories and then use this PHP Snippet to change the homepage:

add_filter( 'option_generate_blog_settings', 'lh_custom_search_results_page_settings' );
function lh_custom_search_results_page_settings( $options ) {
    
    if ( if ( is_front_page() && is_home() ) ) {
        $options['column_layout'] = false;
	    $options['post_image_position'] = 'below-title';
    }
  
    return $options;
}
This archived topic is closed to new replies.