Show the Navigation Block's Mobile Menu on Tablets Too
Switches the Navigation block to its hamburger (mobile) menu up to 1024px wide instead of 600px, so long menus no longer squeeze or wrap on tablets.
Opens WPIDE on
Code
@media (min-width: 600px) and (max-width: 1023px) {
.wp-block-navigation__responsive-container-open:not(.always-shown) {
display: flex !important;
}
.wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
display: none !important;
}
}
Notes
Change 1023px to another width to move the breakpoint. Only affects Navigation blocks set to show the overlay menu on mobile.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.