Archived topic
Mega menu code not working - now menu shows all my published pages int
3 replies · Started by Desiree on July 20, 2018
Hi, tried to insert a code for a mega menu (in Customize > Additional CSS) and sorting the mega menu by using the ordinary appearances > menus structures. But the Mega menu code isn't working anymore - instead my main menu now shows all my published pages isntead of the pages choose by the appearances > menus structure- and I've tried to remove the code entirely but it still doesn't change...
I don't know if it has anything to do with some other codes or settings but this is the code I :
@media (min-width: 769px) {
nav .main-nav .mega-menu {
position: static;
}
nav .main-nav .mega-menu > ul {
position: absolute;
width: 100%;
left: 0 !important;
}
nav .main-nav .mega-menu > ul > li > a {
font-weight: bold;
}
nav .main-nav .mega-menu>ul>li {
display: inline-block;
width: 25%;
vertical-align: top;
}
nav .main-nav .mega-menu.mega-menu-col-2>ul>li {
width: 50%;
}
nav .main-nav .mega-menu.mega-menu-col-3>ul>li {
width: 33.3333%;
}
nav .main-nav .mega-menu.mega-menu-col-5>ul>li {
width: 20%;
}
nav .main-nav .mega-menu > ul > li:hover > a,
nav .main-nav .mega-menu > ul > li:focus > a,
nav .main-nav .mega-menu > ul > li[class*="current-"] > a,
nav .main-nav .mega-menu ul ul {
background-color: transparent !important;
color: inherit;
}
nav .main-nav .mega-menu ul .sub-menu {
position: static;
display: block;
opacity: 1;
visibility: visible;
width: 100%;
box-shadow: 0 0 0;
left: 0;
height: auto;
}
nav .main-nav .mega-menu ul.toggled-on .sub-menu {
pointer-events: auto;
}
nav .main-nav .mega-menu .sub-menu .menu-item-has-children .dropdown-menu-toggle {
display: none;
}
}
Hi there,
Have you assigned that specific menu to be the primary menu in theme location?
https://docs.generatepress.com/article/using-the-wordpress-menu-builder/#setting-a-theme-location
Hello,
That's right, the code doesn't work anymore. I just put it on and it doesn't work.
And yes, I have activated the menu and added the class.
Regards
Can you open a new topic and link us to your site in question?
Tom updated the code not that long ago so make sure you are using the latest one:
https://docs.generatepress.com/article/building-simple-mega-menu/