Hide navigation menu
-
Hi, i see that the theme works the way i want in the mobile version, cause it shows the navigation menu so you can unroll it when you click in the icon.
http://www.blogodisea.com/screenmobile.jpg
But in the desktop version, all the menu it shows by itself. Cause i have much categories and it’s ugly to see them at once, i would love to have the same icon for unrolling this menu in the desktop version. Or maybe something that you can unroll or see when you put the mouse over it.
http://www.blogodisea.com/screenpc.jpg
If there’s nothing to put it that way in the desktop version, if there’s a solution to hide the navigation menu for the desktop version, so i can put the list of categories in a right sidebar or something similar.
The page I need help with: [log in to see the link]
-
Hi there,
Can you try this PHP snippet and see if it works for you?
add_filter( 'generate_mobile_menu_media_query', function() { return '(max-width: 2000px)'; } );Adding PHP: https://docs.generatepress.com/article/adding-php/
Let me know π
Thank you, it worked at least for not showing all categories in the desktop. But as i don’t like the way it shows the list, i’m wondering if it’s possible to make two types of menus and show one type of menu for mobile or tablet users, and the other type for desktop users.
My problem is that i have a big number of categories and i don’t know how to show them the way i want. I know that in mobile or tablet small screens, there’s no a better way to show a large list of categories, but i would like to show the large list of categories the way it describes here: https://docs.generatepress.com/article/building-simple-mega-menu/
The problem is that this mega menu is ok for desktop users, but is ugly and not useful for mobile or tablet users. Don’t know if there’s a way to show one type of menu for mobile or tablet users and another type of menu (mega menu) for desktop users.
That mega menu CSS is using media query
@media (min-width: 769px) { }so it should only be desktop only and leave the mobile menu unaffected.But as i’m using the same menu for both situations, with child and grandchild items, the mobile menu looks bad.
It will me good a way to make decisions, so if you are a desktop user, it will show the menu 1 for example, and if you are mobile user, it will show the menu 2 (with no child or grandchild items).
This problem can be easily solved if you have the premium plugin so you can use the off canvas navigation for mobile only:
https://docs.generatepress.com/article/off-canvas-panel-overview/With the free theme, you can basically add all the menu items twice, then hide one on desktop/mobile using the built-in
hide-onclasses in the first example here:
https://docs.generatepress.com/article/responsive-display/#using-our-hide-on-classesThank you, i will look for it then.
No problem π
So is there a way to hide the navigation bar for desktop users applying hide-on-desktop class to the navigation section?
There is, but it’s likely easier to just use CSS:
@media (min-width: 769px) { #site-navigation { display: none; } }Let me know if that helps or not π
The topic ‘Hide navigation menu’ is closed to new replies.
