I’m working on a child theme of Vantage Premium where I use several menus, my problem is that I don’t want all of them to retract on mobile. I would like to select by id or slug which menus I want to be responsive or which I don’t.
I thought the right place to do this would be the ‘siteorigin_mobilenav_nav_filter’ function but I don’t see how to specify if I want a menu to be affected or not.
Is there any way to do this without modifying the core?
Hi Ovejabeja
mobilenav.js walks the main menu and creates a new one for the mobile navigation. I’d need to seek out consulatation from our dev team on how you might change that behaviour.
Something you can do right now that’s relatively quick and easy is this:
1. Install: https://wordpress.org/plugins/menu-items-visibility-control/
2. Go to Appearance > Menus, select your primary menu and edit a menu item you don’t want showing up for mobile.
3. Locate the new Visibility field in the menu item and insert:
This won’t hide the menu item if you’re resizing your browser window, but, it will hide the menu item for a mobile device which is where the mobile menu is almost always used.
In the end I solved it without the need of installing a plugin. In case it helps someone, in the functions.php of my theme I wrote:
Nicely done :) Really glad to hear you were able to resolve.
(For anyone else reading, please, remember to add new functions like the above to your child theme’s functions.php file).