Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #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

    #1221034

    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

    #1221126

    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 ?

    #1221281

    Thank you Guenni007, this code worked great !

    #1221538

    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

    #1223168

    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

    #1223287

    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

    #1223466

    Thanks Rikard !

    #1223515

    Hi,

    Did you need additional help with this topic or shall we close?

    Best regards,
    Jordan Shannon

    #1223605

    You can close this. Thanks again !

    #1223851

    Hi Blacktigerke,

    Great :)

    We are closing the thread.

    If you need further assistance please let us know in a new one.

    Best regards,
    Victoria

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Always display Hamburger menu on specific page.’ is closed to new replies.