Archived topic
Change menu for sticky navigation
6 replies · Started by Terence on September 19, 2019
I am not sure if this is possible with GP Premium but this is what I want to accomplish.
I need the sticky menu to replace the primary menu on scroll. Fortunately, using the sticky navigation option in GP Premium it does that right out of the box.
But, I also want to replace the menu in the sticky header at the same time, so that I would have the primary menu initially (for better SEO), and an alternative (secondary) menu on scroll (for better user experience).
Is that going to be possible with an element, and a hook or filter?
Any help in getting me on the right track would be much appreciated.
Terence.
Hi there,
The only solution I've seen previously is to add all the menu items you want for static and sticky navigation into one menu then hide the static menu items using CSS when it's in sticky mode.
Does that help at all?
If so I can provide the CSS :)
Let me know :)
Hi Leo,
Funny enough I was thinking of trying to do something like that, only using the "If Menu" plugin - Visibility control for menu items.
The problem I was facing — with a hundred or so menu items, each requiring to be set up manually — it was going to take for ever.
Doing it with CSS programmatically would certainly be a lot quicker. Can I take you up on your offer and have you show me how that could work please?
Many thanks,
Terence.
Hey Leo,
When I thought about it a little more and worked out the logic it was extremely easy to do it with the "If Menu" plugin. So easy in fact, it would only be worth reinventing the process with CSS if it was going to positively impact either the page load speed or SEO.
Terence.
Wouldn't be very with CSS if you have a lots of categories and menu items to sort through.
If Menu is definitely the better solution :)
Glad you made it work!
Thanks Leo. Its so little work with "If Menu" I'm surprised I didn't think of it earlier.
No problem :)