Hi, is there a possibility to have the hamburger menu just on the homepage? All other sites should show the normal text based menu.
Thx a lot in advance!
Hi WebbR,
Is the hamburger menu on desktop or only in mobile?
Best regards,
Nikko
use that filter : avf_burger_menu_active
function custom_burger_menu_active( $active, $context ){
if( is_page(3) ) {
return true;
}
return $active;
}
add_filter('avf_burger_menu_active', 'custom_burger_menu_active', 10, 2 );
change the is_page to your homepage id or use is_home( ) or is_frontpage( )
(yes there are differences between them – wheather the landing page is blog page or static page ;)
@Guenni007 Yeah! Thanks! That’s what I was looking for! I suppose the number in if( is_page(3) ) can be an array also?
@Nikko question regarding only desktop view. Mobile should be hamburger menu anyway.
Thank you!
Yes of course:
function custom_burger_menu_active( $active, $context ){
if(is_page(array( 3, 81))){
return true;
}
return $active;
}
add_filter('avf_burger_menu_active', 'custom_burger_menu_active', 10, 2 );