There isn’t an is_mobile()
function to my knowledge. WordPress uses a wp_is_mobile()
which is probably what you’re looking for. So it should look like this:
<?php if ( wp_is_mobile() ) { wp_nav_menu( array('menu' => 'mobile' ) ); } else { wp_nav_menu( array('menu' => 'primary' ) ); }; ?>
EDIT
After reviewing your question further it seems like you have a plugin installed to browser sniff for you. It does look like it uses is_mobile()
but since I am unfamiliar with the plugin I would suggest going vanilla with wp_is_mobile()
instead of using a plugin, who knows what could be wrong with the plugin or if the plugin is compatible with your installation.
FINAL EDIT
It turns out according to OP that the menu names were not matching.
Related Posts:
- WordPress Menu Exchange On Tablet’s Orientation
- 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?
- Split up wp_nav_menu with custom walker
- how to create a menu with all sub categories?
- How to change order of menu items
- Remove unusable metaboxes in nav menu management screen
- Add Commas Between Menu Items?
- Allow html tags in WordPress Custom Menus Description Field
- Add custom attribute to menu item link using Filter
- Bootstrap drop down menu with wp_nav_menu
- Remove nav menu or menu item
- Building a Sub-menu: Display Parent Category/Page’s Children When Viewing Children
- Getting stripos error when trying to add menu classes
- Custom Walker for Walker_Nav_Menu
- Make compatible custom menu widget for Twitter Bootstrap
- Different side menu on each page
- Replace menu permalink/hyperlink with only menu name/slug
- Variables within wp_nav_menu
- wp_update_nav_menu_item not saving in multisite API
- get_search_form() doesn’t appear to take parameter into account
- Header style different on home and remaining pages
- Pass GET params to URL from a main menu item
- Schedule Page to Menu [duplicate]
- Limit the menu child levels under “admin > appearance > menus”
- display menus on all page except one?
- Show Menu from one WordPress install in another WordPress install
- Check if Page Already Exists in Menu
- Is this format possible with a custom Nav Walker class?
- Add code to WordPress menu items by class
- How do you add a around the second level of a Menu?
- custom walker nav issue involving ajax
- Remove admin menu
- Give child-categories same class (the parent category-slug) as parent in menu list?
- How Do I Add Images To Main Navigation Menu
- Is it still not possible to show separate submenu with “Custom Menu”?
- Three menus – parent / child / sibling
- WordPress Nav Walker – Top menu link with dropdown link not clickable (dropdown opens)
- Rename the label on a menu location which is already defined?
- How to making dynamic URLs for menus in WordPress?
- swap out only main menu for logged in users
- Add custom class to li element which has children
- How to Show Different Menus to Logged in Users in WordPress [duplicate]
- Appearance > Menus > Left Sidebar > Add Toggle
- How to open a lightbox form from a navigation menu item
- Echo Menu located in primary navigation
- Navigation item – current date in url
- why are my walker menu is showing like this?
- Bootstrap Theme Migrated to WordPress
- How to remove top menu item and font awesome icon in WordPress menu?
- Menu with sub-items but without link
- Creating navigation out of specific IDs and their children?
- I can´t make the menu unclickable in an easy way
- 2nd level (drop-down) of the navigation menu not working [closed]
- Add active class to wp_nav_menu
- how to configure this type of menu
- Migrate WP Menu between sites
- How to style wp_nav_menu?
- How to inject HTML to secondary menu on front end?
- Different colors for navigation bar
- WordPress Navigation default output
- Is there a limit to number of pages displayed for selection in custom menu?
- Convert HTML code to WordPress menu
- Add monthly archives menu and submenu
- wp nav menu – highlighting current page not working properly [closed]
- Hamburger Navigation Menu
- One item on menu is not clickable when it should be
- Critical Error when editing menu