Archived topic
How to hide Off-canvas Slide-out sidebars from Homepage??
5 replies · Started by Ravi Dixit on May 25, 2019
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 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:
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.
I have sat it up and it is working good, thanks for the help.
Awesome - glad to hear that :)