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

Home Forums Support [Resolved] How to hide Off-canvas Slide-out sidebars from Homepage??

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

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #910333
    Ravi Dixit

    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?

    #910383
    David
    Staff
    Customer Support

    Hi there,

    you could use the Menu Options filter here to enable / disable the slideout:

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

    WP Conditional tags explained here:

    https://codex.wordpress.org/Conditional_Tags

    #910413
    Ravi Dixit

    Hi, David!

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

    can you please make it easy for me?

    #910580
    David
    Staff
    Customer Support

    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/

    #910616
    Ravi Dixit

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

    #910743
    David
    Staff
    Customer Support

    Awesome – glad to hear that 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.