cybmeta is right you cannot trust server-side browser detection
<div class="portrait">
wp_nav_menu( array('menu' => 'primary' ) );
</div>
<div class="mobile">
wp_nav_menu( array('menu' => 'mobile' ) );
</div>
<div class="primary">
wp_nav_menu( array('menu' => 'primary' ) );
</div>
and use media queries to hide and display menu
Related Posts:
- WordPress Menu Exchange for Mobile Layout
- How to stop mobile theme inheriting desktop navigation menu?
- How to get a different mobile menu than desktop menu in the twentytwelve child theme
- Second nav is merged with the first in mobile
- Does WordPress create mobile menus automatically?
- Mobile menu works on local XAMPP, but not on GoDaddy [closed]
- WordPress Split Menu
- TwentyTwelve child theme mobile menu not working
- How to add a submenu toggle button inside all “li” elements that have a submenu?
- Convert WP Menu to a Drop Down for Mobile browser
- Add Button to Bottom of Mobile Menu
- burger on mobile
- Uber menu, manual integration, disable Mobile
- My Temptation theme is showing two of the same menu at the top. How do I remove the one that the theme comes with? Please help! [closed]
- Replace the slug of parent pages with # [closed]
- Menu Not Showing on Mobile
- Efficient wp mobile menu
- WordPress website – Mobile menu behavior help
- (Mobile) Hamburger menu disappeared from a page (only one)
- My menu doesn’t fit in the default screen in the mobile version
- Top bar menus not showing on mobile
- Mobile navigation javascript problem
- Replace the page url with a menu link?
- Mobile menu displays submenus on top of parent. Need it to display right below on an own line
- Menu doesn’t open on mobile
- Change menu for mobile
- Add href to tag in nav menu for mobile
- Disable Top Nav Bar on Mobile
- Mobile menu not working – jQuery error?
- menu mobile show up even i in desktop mode in Newspaper Theme
- Mobile Menu Not Working
- Theme: Twenty Thirteen Mobile Sliding Menu Doesn’t Bump Content Down
- Navigation menu, remove item from desktop
- Changing when mobile menu is displayed
- How can I only show one responsive menu on mobile devices?
- How to organize the header elements, so that it doesn’t come out differentin mobile view
- How to Hard Code Custom menu items
- Check if page is in a certain menu
- Increase search results for Admin -> Appearance -> Menus -> Search (default is 10)
- Is it possible to add classes to list items in wp_nav_menu()?
- How do I add the data-toggle=”modal” data-target=”#myModal” attribures to a WP Nav bar?
- Page not appearing in navigation bar
- Extend WordPress REST API to show slugs for menu items
- WordPress Custom Menu Widget Style
- Output menu navigation in php file
- display only the wp_nav_menu, which has the current-menu-item
- Unclickable Menu Item Label in Custom Menu with Clickable Children
- Remove Metabox from Menus screen
- How to fix “Supplied nav_menu_item value missing property” after update to WordPress 5.0
- How to add programmatically all pages and children to backend menu
- How do I add recent posts to the menu?
- Conditional secondary menus
- Create a MegaMenu using a walker and the start_lvl function
- Nav and logo loading each time causing menu to move JointsWP – Foundation 6
- Creating a menu containing categories and authors
- Change submenu markup
- Get page slug/id from position in menu
- Container class not appearing on navigation menu
- Active Menu Highlighter with Subpages?
- WordPress template – How to add class to li tag if submenu exist
- styling wp_nav_menu – horizontal, sub-menu drop downs
- Show children (sub-navigation) of active menu item only
- Highlighting top level link when viewing one of it’s sub-pages, which are not linked in the menu
- Make menu items open in new tab/page
- Adding top level items in the admin menu that link to a post
- How do I hide “Pages”, “Media”, “Comments”….for editor role?
- how to change the color of menu text wordpress?
- Need a menu on left sidebar of the page with below requirements [closed]
- add login menu with submenu
- How to make top level menu think it has a current item
- Generate Navbar In WordPress
- Showing home button in a specified menu
- Odd spacing in Navigation Bar [closed]
- Registering a static menu?
- Add session or cookie to remember last menu location
- sub.menu’s not working
- How to change how WordPress renders navigation menu on Block Themes
- url_to_postid method in walker_nav navigation menu causing exceptionally high TTFB
- wp_nav_menu container style args
- Structuring Nav Menu and Background Custom page (Help)
- How To Add The Help Scout javascript LiveChat from the WordPress menu
- Adding additional html to the end of the root level in a custom nav walker
- wordpress custom menu – show parents, siblings, children depending on depth
- add_theme_support( $feature=’menus’ )
- How to remove Nav-Menu tooltips? (Wp-Globus plugin)
- Build a one-page navigation within a non-one-page ttheme…
- Add class to specific li item menu in function.php
- WordPress customizing a walker menu class
- how do you create this customize menu using wp_nav_menu function?
- Ubermenu cant handle my menu, how to deal with large number of menuitems?
- When submitting more than 200 menus, I get “Service Temporarily Unavailable”
- Limit the amount of menus someone can make
- Navigation list not correctly styled on pages with custom template (missing .current-menu-item)
- I can’t click on top menus [closed]
- wp_nav_menu doesn’t add current-menu-item when there is an url parameter [closed]
- my theme automatically adds new pages to menu
- How can I added the post’s Categories to the site’s top menu (like a page)?
- Control page access based on User Meta data?
- why did the homepage button go down from the row of other menu items when I deleted text within the navigator information?
- Drop down menu that updates block content