Site logo

Archived topic

Can i do Content layout to one container only just for one page

3 replies · Started by hemunt on April 2, 2020

Viewing posts 1–4 of 4

I want to do a Content layout to one container only just for my home page and else other pages I want them to be Separate container. How can I do that?

Hi there,

you can use the Filter options provided here:

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

For example this will make the home page a single container:

add_filter( 'option_generate_settings','db_home_page_settings' );
function db_home_page_settings( $options ) {
    if ( is_front_page() ) {
        $options['content_layout_setting'] = 'one-container';
    }
    
    return $options;
}

Thanks, You guys are wonderful. And so helpful

Glad we can be of help

This archived topic is closed to new replies.