Greetings everyone,
I’d like to know if it’s possible to create a different menu for mobile.
What I’ve done so far.
I’ve put inside my functions.php file these two scripts in order to enable the option for Mobile Menu in WordPresse’s Menu Tab
add_action( 'init', function() {
register_nav_menu( 'mobile-menu', __( 'Mobile Menu' ) );
} );
add_filter( 'generate_mobile_header_theme_location', function() {
return 'mobile-menu';
} );
I’ve created a new menu and named it “Mobile Menu” and checked the box for Mobile.
Unfortunately though it doesn’t work since I can’t see any changes on the frontend and also while inspecting my page classes, and menu ids are of primary’s menu.