Hello,
I want to change the menu in a hamburger menu on a specific page only.
Hamburger menu on all devices for that page.
Can this be done?
Thank you
Bart
Hey Bart,
I’m not sure if that can be done, but send us a link to the page in question and we’ll have a closer look at it.
Best regards,
Rikard
this for your child-theme functions.php:
Change if clause to your needs.
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 );
or do you mean: different menu items in the hamburger menu of a specific page ?
Thank you Guenni007, this code worked great !
Hi Blacktigerke,
Great, I’m glad that @guenni007 could help you out :-)
Please let us know if you should need any further help on the topic or if we can close it.
Best regards,
Rikard
Hello,
I want a second page to have an hamburger menu. How do i change this code?
function custom_burger_menu_active( $active, $context ){
if( is_page(‘page1’) ) {
return true;
}
return $active;
}
add_filter(‘avf_burger_menu_active’, ‘custom_burger_menu_active’, 10, 2 );
Thank you
Hi,
Please try this instead:
function custom_burger_menu_active( $active, $context ){
if( is_page( array( 'page1', 'page2' ) ) ) {
return true;
}
return $active;
}
add_filter('avf_burger_menu_active', 'custom_burger_menu_active', 10, 2 );
Just replace page2 with the name or ID of your other page. https://developer.wordpress.org/reference/functions/is_page/
Best regards,
Rikard
Thanks Rikard !
Hi,
Did you need additional help with this topic or shall we close?
Best regards,
Jordan Shannon
You can close this. Thanks again !
Hi Blacktigerke,
Great :)
We are closing the thread.
If you need further assistance please let us know in a new one.
Best regards,
Victoria