- This topic has 6 replies, 3 voices, and was last updated 3 years, 6 months ago by Leo.
-
AuthorPosts
-
September 27, 2020 at 11:31 pm #1461736Austin
Hello,
I’ve used both the generate_inside_navigation and generate_after_primary_menu hooks to add a feature to the right of a right floating navigation… and it always shows up to the far left (of both site logo and primary menu). The hooked html is wrapped in a div and I’ve added right float css to that div class. I’ve tried a “menu-item-float-right” class I saw referenced in a GP nav bar + icons article. I’ve also tried left floating the primary-menu ID css and via the Navigation Alignment float options. Nothing works.
Any ideas? No caching, on WAMP localhost using private browser settings.
September 28, 2020 at 2:02 am #1461850DavidStaffCustomer SupportHi there,
can you provide a link to the site so i can see the issue.
I think its just a couple of lines of CSS to re-order those elements.September 28, 2020 at 10:05 am #1462599AustinHello,
Pushed to a live server for you. (Temporary link shortening service, wait 5 seconds to continue): https://www.temporary-url.com/90C
Currently using the generate_after_primary_menu hook
The Div class on the hooked content is “donate-button”.September 28, 2020 at 12:05 pm #1462742LeoStaffCustomer SupportHi there,
Are you trying to add the Donate button on the left of Sample Page?
If so can you try using this method?
https://docs.generatepress.com/article/adding-buttons-navigation/Let me know if I’m missing something ๐
September 28, 2020 at 12:46 pm #1462791AustinLeo,
Thanks for the reply. Yes, I want to add an element to the right of the primary menu.
I realized that custom class could be used with a menu item. However, let’s assume that it was not a button to be added but something else, like php for email optin or a login form. Is there no way to get that to the right using generate_after_primary_menu and not hacking the core files (which would likely lead to responsivity issues)? The HTML renders in the right order here so I would think it’s a CSS problem but I can’t seem to figure it out. I suspect the answer will seem obvious when I do figure it out.
I’ve seen support tickets from the past in which people use generate_after_primary_menu and generate_inside_navigation to get thing to the far right of the nav bar but I don’t seem to be able to replicate that.
September 28, 2020 at 1:11 pm #1462821AustinLeo/David/Tom,
I found the solution to my issue:
The primary menu has an order property of 4, so adding an order property of 5 to the hooked element solves the problem.element.style { order: 5; }
Sorry to take up your time with something so silly.
September 28, 2020 at 1:24 pm #1462836LeoStaffCustomer SupportGlad you’ve figured out ๐
No problem at all!
-
AuthorPosts
- You must be logged in to reply to this topic.