Site logo

Archived topic

Open Certain Menu To The Left

10 replies · Started by Dave on February 22, 2017

Viewing posts 1–11 of 11

Hey Tom,

Looking at this documention, I implemented the CSS to open sub-menus to the left:

https://docs.generatepress.com/article/navigation-dropdown/

However, I'm looking to only apply that to the furthest right drop down menus, not to all of them. The far right ones go off screen so I'd like them to open to the left. The others, I'd like to have them open like they are set to in default, to the right. Is that possible?

Thanks!
- Dave

Hi Dave,

First add open-left to the Custom Classes field for the far right menu item:
https://docs.generatepress.com/article/using-the-wordpress-menu-builder/#custom-classes

Then replace the CSS from the doc page with this:

.dropdown-hover .main-navigation ul .open-left ul {
    left: auto;
    right: 0;
}

.dropdown-hover .main-navigation ul .open-left ul ul {
    left: auto;
    right: 100%;
}

.dropdown-hover .main-navigation .main-nav ul .open-left ul li.menu-item-has-children > a {
    padding-left: 0;
    padding-right: 20px;
}

.dropdown-hover .main-navigation ul .open-left ul .menu-item-has-children .dropdown-menu-toggle {
    float: left;
    padding-left: 20px;
    padding-right: 15px;
}

.dropdown-hover .main-navigation .open-left .children .dropdown-menu-toggle:before, 
.dropdown-hover .main-navigation .open-left .sub-menu .dropdown-menu-toggle:before {
    content: "\f104";
}

Let me know.

Aw wow I should have known that. Thank you Leo!

Wasn't easy for me either haha You're welcome :)

Might I suggest this solution be added to the KnowledgeBase article referenced by the OP?

Navigation Dropdown

I came upon that great page yesterday, but it took quite a while using Search to find this more appropriate solution.

Thanks!

I agree :)

Done :)

Outstanding, thanks for the fast response.

Thanks for the suggestion :)

Hi Dave,

First add open-left to the Custom Classes field for the far right menu item:
https://docs.generatepress.com/article/using-the-wordpress-menu-builder/#custom-classes

Then replace the CSS from the doc page with this:

This doesn't seem to work anymore when dropdown is set to the right in Customizer. Only the icon moves to the left, but the dropdown still opens to the right (and gets cut off). Reverted it back to the original.

Update: Works now. Used the CSS from the documentation article and added the custom class manually.

This archived topic is closed to new replies.