Site logo

Archived topic

How to hide Off-canvas Slide-out sidebars from Homepage??

5 replies · Started by Ravi Dixit on May 25, 2019

Viewing posts 1–6 of 6

I have enabled Off-Canvas sidebars and added widgets as well.

It is working quite good, I was thinking if I show off-canva sidebars only on posts, and blog page.

Is it possible?

Hi, David!

I dont know a single bit of coding so not able to understand this...

can you please make it easy for me?

The PHP function would look something like this:

add_filter( 'option_generate_menu_plus_settings','lh_custom_homepage_menu_plus_settings' );
function lh_custom_homepage_menu_plus_settings( $options ) {
    if ( is_page() || is_front_page()  ) {
        $options['slideout_menu'] = 'false';
    }
    
    return $options;
}

Which means if its a page is_page() or || it is the front page is_front_page() then set the option for slideout menu to false.

https://docs.generatepress.com/article/adding-php/

I have sat it up and it is working good, thanks for the help.

Awesome - glad to hear that :)

This archived topic is closed to new replies.