Archived topic
Right menu element
3 replies · Started by Clevelus on November 13, 2020
How do I now make the one menu item on the right?
For example, place a phone number to a magnifying glass (search button)?
It used to be possible with such a class, but now it doesn't work.
nav li.menu-right (worked on older versions generatepress) or
.menu-right {
float: right;
text-align: right;
z-index: 21;
}
Using the class menu-item-float-right from the help from here doesn't help either.
https://docs.generatepress.com/article/adding-icons-to-menu-items/?ref=1661
Hi there,
try adding this CSS:
@media(min-width: 1024px) {
.main-navigation .inside-navigation .main-nav {
flex: 1;
}
.main-navigation li:last-child {
margin-left: auto;
}
}
It works, thanks.
But there is no way to control which menu item (there can be more than one) should be on the right (my code below works too, but lacks understanding of how the new theme works).
Well, this is not in the documentation, which is very bad (with the transition to the new version of the GP, a lot has changed)
@media(min-width: 1024px) {
.main-navigation .inside-navigation .main-nav {
flex: 1;
}
/*.main-navigation li:last-child {
margin-left: auto;
}*/
li.menu-right {
margin-left: auto;
}
}
I believe this hook would help:
https://docs.generatepress.com/article/generate_menu_bar_items/
The video shows some examples as well.
You can control the order by using the priority field.