[Support request] Category page in columns

Home Forums Support Category page in columns

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1250289
    Jee

    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!

    #1250716
    David
    Staff
    Customer Support

    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;
    }
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.