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?
- How to organize the header elements, so that it doesn’t come out differentin mobile view
- wp_get_nav_menu_items() not working with slug
- Error “Trying to get property of non-object” with Custom Walker for wp_nav_menu
- Add Class to Specific Link in Custom Menu
- How do I add a search box to the nav menu?
- How to move parent li to end of child ul
- wp_nav_menu() loses ‘current-menu-*’ classes on single product page within category
- How is custom menu hierarchy output handled?
- How to fix strange 500 Error after Editing Menu?
- Remove ‘Menus’ from Twenty Sixteen theme Customizer
- Custom nav walker with different output depending on depth
- Override custom menu widget
- Placing widget to menu
- container_class doesn’t seem to be working
- Get menu item slug
- Walker_Nav_Menu: Items not nested correctly
- Loop through Navbar, Output Icons
- Custom Walker anchor tag not inheriting attributes
- How to display dynamic content in start_lvl function
- Partial refresh of menu in customizer not working?
- Add custom -element to wp_nav_menu
- Disable automatig SVG tag from menu
- next_post_link() on custom menu structure
- Different fields available for different sites when when customising Menu’s
- Custom walker with hashes instead of links (one-page layout)
- Find out if a page has no parent
- wp_nav_menu() showing list in a different Position?
- Can’t include Language switch in Nav Menu
- Using website header, menu and footer on WordPress blog
- Can only get one of two custom menus to display
- wp_nav_menu not working [closed]
- Getting the current menu item id from specific menu
- How should I build a custom menu walker for this setup?
- Adding an admin menu page showing the link twice – how to solve this?
- Listing Child Pages in a Certain Order?
- WordPress + Bootstrap [closed]
- wp_nav_menu action/filter help
- Trying to add a custom social icon to a Twenty Twenty-One child theme
- Navigation menu not visible (contrast issue) on home page
- Full screen nav menu block with avada theme
- functions.php adding item to end of menu. I want to change position
- WordPress menu>Custom Link: removing my link formatting and adding %20
- Removing a page from the header menu
- Splitting up a submenu into columns, or putting existing menus in another menu as submenu item
- wp_nav_menu does not take arguments?
- “Widgets” menu doesn’t appear
- WordPress always display the first menu
- horizontal menu / 4-level depth
- 500 Internal Server Error when Trying to Save Menu [closed]
- How do I convert a custom menu wp_get_nav_menu_items into Fourth level?
- Need to remove the admin menu item from a be theme in wordpress
- How to add CSS class to and and id in a nav menu with code?
- Roles see different top menu (nav menu)
- Where to place a svg chevron down in my custom walker?
- Output existing wp_nav_menu with a custom walker
- Has there been any improvements to wp’s menu handling?
- How can I edit submenu headings using wp_nav_menu walker?
- How to get the title of root li element
- How make top level menu item not have link, but have sub-menus that are linked?
- Add Menu Item in Specific Order
- Determine if a navigation item has children
- Any way to use classic Menus in Full Site Editing?
- WordPress menu empty of items
- Give custom class names to WP nav sub-menu
- Live site menu links pointing to staging site pages