Archived topic
How do I create a sub row of navs in header
26 replies · Started by Carsten on April 2, 2020
Hmm, that should work. I tried checking out your site but it isn't loading for me right now Can you check?
Try again now, please
Where are you using the secondary navigation?
My idea is to have the primary menu as mobile (hamburger) menu, also on desktop, and then the secondary navigation below with a few of the links most used.
Have you actually added the secondary navigation to your site? The hook won't work unless it's on the page.
Without it, you'll need to hook your own HTML element into the page and style it with CSS.
You were right, I didn't add a secondary menu in the menus settings, sorry about that.
This is new to me, that I could actually add a secondary menu in the settings, please clarify why, and when I instead should add the secondary menu using a hook element?
Thanks
You would only add the Secondary Navigation using a Hook element if you want it in a Location that cannot be chosen in Customizer > Layout > Secondary Navigation.
Looking at your original screenshot you can just set its location to Below Header.
Thanks, so if I would like to exclude the secondary navigation on my frontpage, I have to use a hook.
Regarding Below Header, there is no such hook location, only an after_header, is this the one, or do you mean a custom hook called below_header?
Thanks again
In the Customizer > Layout > Secondary Navigation you can set the Location - the Below Header option places it where you want it ( based on your screenshot ).
And if you want to remove it from the Front Page you can use a Layout Element:
https://docs.generatepress.com/article/layout-element-overview/
This gives you the option to Disable > Secondary Navigation.
Working perfectly, thanks!
Glad to hear that
Closed