[Resolved] Duplicate Secondary Nav Below Primary Nav for Mobile

Home Forums Support [Resolved] Duplicate Secondary Nav Below Primary Nav for Mobile

Home Forums Support Duplicate Secondary Nav Below Primary Nav for Mobile

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #671128
    Arthur

    I have a Secondary Nav above the Primary Nav on desktop view and I want to hide the Secondary Nav on mobile and display it below the Primary Nav on mobile in either the default dropdown style or the Slide Out style.

    Would I need to create a hook to place the Secondary Nav menu below the Primary Nav (possibly via wp_nav_menu() and the generate_inside_navigation)?

    add_action('generate_inside_navigation', 'dup_secondary_nav');
    function dup_secondary_nav() {
    wp_nav_menu(array( 'theme_location' => 'secondary_nav' ))
    }

    Please help.

    #671133
    David
    Staff
    Customer Support

    Hi there,

    how about creating a new menu that is a combination of those used in the Primary and Secondary Navs and then assign this to the Slideout Navigation?

    #671136
    Arthur

    Thanks for the quick response David. I didn’t want to have to manage multiple (or duplicate) menu items. I want to take the current Secondary Nav and generate it again below the Primary Nav.

    Does that make sense?

    #671143
    David
    Staff
    Customer Support

    Just to be clear, on mobile will you be displaying Two Hamburger menus (primary on top / secondary below)?

    #671149
    Arthur

    No. In the DOM, the Secondary Nav will be placed below the Primary Nav. I believe I can use the Primary Toggle to open both menus. Is that possible?

    You can see an example here (this sample is from a custom theme): http://www.odifusa.com/about-us/

    #671300
    Tom
    Lead Developer
    Lead Developer

    I don’t think there’s a good way to merge them really. From a performance standpoint, creating a separate Slideout Navigation menu is the way to go.

    I suppose you could try javascript to move the secondary navigation items into the slideout navigation, but that would be less than ideal when it comes to performance.

    #671343
    Arthur

    Thanks Tom and David.

    #671581
    Tom
    Lead Developer
    Lead Developer

    No problem!

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.