- This topic has 25 replies, 2 voices, and was last updated 3 years, 10 months ago by Leo.
-
AuthorPosts
-
June 23, 2020 at 3:59 am #1338487Carsten
Hi there, it’s just created in an element, no classes created. Apparently class for hover is not created neither, why does hover work without class definition.
I have been looking around for this topic without any solution, any documentation on how to create the
current-menu-item
class for the sub-nav?Regards
June 23, 2020 at 9:20 am #1339044LeoStaffCustomer SupportHover is a pseudo selector so can be used on every element.
current-menu-item
would require javascript to add it in (it’s not a theme issue so we cannot help with this)- it’s available by default when you use WordPress menu system.Would you consider actually using the secondary navigation instead of using a custom element?
June 23, 2020 at 11:56 am #1339248CarstenYes, defiantly, if I can have the same position, I don’t need a custom element, no need to make it more complicated, I just think I starter up the wrong way 😉
June 23, 2020 at 12:50 pm #1339314LeoStaffCustomer SupportYup you should be able to position the secondary navigation where the current custom element is.
June 24, 2020 at 2:50 am #1339903CarstenHi there, I have now created a secondary navigation, but why does it appear both as ordinary inline menu and mobile menu on mobile?
I have been going through all settings without finding the solution to this. Furthermore, there are no breakpoint settings for the secondary menu, so I can’t see, how I can control this?
Just to clarify, then I wan’t to keep the mobile primary menu on desktop, but the secondary menu should remain a normal menu both on desktop and mobile.
How do I turn of the extra mobil menu in secondary?
Thanks
mobile
desktop
June 24, 2020 at 9:25 am #1340480LeoStaffCustomer SupportWeird. It definitely shouldn’t show like on mobile by default.
Are you adding this PHP function?
https://docs.generatepress.com/article/disable-secondary-navigation-mobile-menu/If so make sure to add the CSS as well.
June 24, 2020 at 3:17 pm #1340769CarstenHi there, no the function is not added in my functions.php
I have discovered a strange behavior of the secondary nav.
If I deactivate all my custom css, only the mobile secondary menu is displayed in mobile
CSS active
CSS deactivated
On desktop it is working as it should.
June 24, 2020 at 3:35 pm #1340777CarstenOkay, I found this CSS which is about secondary navigation.
If I remove this, the mobile menu remains, and the normal secondary menu disappears, as described above. I makes no sense.
@media (min-width:769px) { .secondary-navigation .main-nav ul li.nav-button a { background-color: #ffffff; border: 2px solid #000000; color: #000000; line-height: 35px; /*this number will likely need to be adjusted*/ } } @media(max-width: 768px) { .secondary-navigation { text-align: center !important; } .secondary-navigation ul { display: block; } .secondary-navigation .sf-menu>li { float: none; display: inline-block !important; } }
June 24, 2020 at 9:27 pm #1340889LeoStaffCustomer SupportCan you remove your previous CSS for the secondary navigation and use the PHP snippet and CSS suggested in this article only?
https://docs.generatepress.com/article/disable-secondary-navigation-mobile-menu/June 26, 2020 at 4:00 am #1342427CarstenHi there, adding the function was enough to remove the mobile menu.
Should I then just leave out the CSS?
Now the issue is solved, but why is it necessary at all, to add extra code just to avoid a double menu?
Thanks
June 26, 2020 at 8:39 am #1342822LeoStaffCustomer SupportThe function and CSS on the doc page make it that the secondary navigation doesn’t collapse into the toggle.
Glad it’s all working 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.