-
AuthorPosts
-
June 8, 2020 at 8:12 pm #1220618
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
June 10, 2020 at 5:00 am #1221034Hey 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,
RikardJune 10, 2020 at 10:39 am #1221126this 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 ?
June 10, 2020 at 5:43 pm #1221281Thank you Guenni007, this code worked great !
June 11, 2020 at 6:54 am #1221538Hi 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,
RikardJune 16, 2020 at 6:57 pm #1223168Hello,
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
June 17, 2020 at 10:00 am #1223287Hi,
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,
RikardJune 17, 2020 at 5:55 pm #1223466Thanks Rikard !
June 17, 2020 at 11:12 pm #1223515Hi,
Did you need additional help with this topic or shall we close?
Best regards,
Jordan ShannonJune 18, 2020 at 7:56 am #1223605You can close this. Thanks again !
June 18, 2020 at 6:18 pm #1223851Hi Blacktigerke,
Great :)
We are closing the thread.
If you need further assistance please let us know in a new one.
Best regards,
Victoria -
AuthorPosts
- The topic ‘Always display Hamburger menu on specific page.’ is closed to new replies.
