- This topic has 6 replies, 3 voices, and was last updated 9 months, 3 weeks ago by
Tom.
-
AuthorPosts
-
May 16, 2020 at 5:32 am #1287050
jhmattern
On a private dev site I’m adding a menu to the top bar (not using the secondary navigation because I’m already using both navigation bars in other places). I can add a basic menu fine using the top bar widget area.
However…
I have a custom function to add login/logout links and a “my account” link for logged-in users to the end of the menu I need in the top bar. And this doesn’t work if the menu is pulled in via a widget area. It needs a menu theme location.
I already did this successfully in my footer menu by registering a new menu and using GP hooks to add that menu before the copyright notice. But I can’t seem to do the same in the top bar because there doesn’t seem to be a way to hook into it.
Is there a hook option I’m missing that will let me insert a newly registered menu inside the top bar?
I saw another support thread where it was suggested the “before_header” hook would work, but it doesn’t. When I do that, it inserts my new menu (including the login/logout links) under the top bar and before the header rather than within the top bar.
Is there any way to hook inside that top bar directly?
Thanks!
May 16, 2020 at 9:15 am #1287462David
StaffCustomer SupportHi there,
there is no Hook within the Top Bar.
You could of course just create your own top bar container using thebefore_header
hook.What else needs to go in the Top bar ?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/May 16, 2020 at 9:37 am #1287489jhmattern
Would that lose the ability to use other widgets there though? I currently have a widget for social media icons floating left and need the menu floating right.
May 16, 2020 at 12:05 pm #1287670jhmattern
Nevermind on this for now. I think it might make more sense to just merge the secondary nav back into the top bar and try to use a hook to create the lower bar beneath my primary nav. So I’m going to mark this resolved for now and will revisit if I can’t get that alternative to work.
May 16, 2020 at 3:00 pm #1287822Tom
Lead DeveloperLead DeveloperSounds good – just re-open this topic if you need to π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMay 18, 2020 at 10:22 am #1290549jhmattern
No need. The other option worked out great. Thanks!
May 18, 2020 at 12:07 pm #1290678Tom
Lead DeveloperLead DeveloperAwesome, thanks for letting us know π
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.