- This topic has 7 replies, 3 voices, and was last updated 3 years, 8 months ago by
Tom.
-
AuthorPosts
-
September 7, 2018 at 6:51 am #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.
GeneratePress 2.1.4GP Premium 1.7.2September 7, 2018 at 6:57 am #671133David
StaffCustomer SupportHi 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?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/September 7, 2018 at 7:00 am #671136Arthur
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?
September 7, 2018 at 7:17 am #671143David
StaffCustomer SupportJust to be clear, on mobile will you be displaying Two Hamburger menus (primary on top / secondary below)?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/September 7, 2018 at 7:25 am #671149Arthur
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/
September 7, 2018 at 9:37 am #671300Tom
Lead DeveloperLead DeveloperI 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.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentSeptember 7, 2018 at 10:33 am #671343Arthur
Thanks Tom and David.
September 7, 2018 at 6:48 pm #671581Tom
Lead DeveloperLead DeveloperNo problem!
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.