Archived topic
sticky menu - use diffrent menu than main menu
5 replies · Started by Anders Nielsen on September 20, 2020
Hi there.. I created a video.
I'm trying to use a diffrent menu, for the sticky menu - is that possible?
Hi there,
tricky one.
My thoughts are:
1. Create a menu that includes all the Menu items for sticky and static.
2. Give the menu items you want displayed on the Sticky Nav only a class of: sticky-item
How to: https://docs.generatepress.com/article/using-the-wordpress-menu-builder/#custom-classes
3. Then add this CSS to your site:
/* Sticky menu display only sticky-item */
.main-navigation.is_stuck .main-nav ul li:not(.sticky-item) {
display: none;
}
/* Static menu remove sticky-item */
.main-navigation:not(.is_stuck) .main-nav ul li.sticky-item {
display: none;
}
It's working.... :)
Thanks
Now I just need to figure out - how make a button in the sticky menu.
So button in sticky menu only?
You should be able to use this method and add the same class as David mentioned above:
https://docs.generatepress.com/article/adding-buttons-navigation/
Yes it works :)
Documentation needs a !important for line-height. :)
Hmm maybe for the sticky navigation part.
Will take a look :)