So, the code in the documentation assumes that the menu you’re trying to get is set as the primary menu. If the menu you’re trying to get isn’t the one set as primaryin Apperance -> Menus, this error will show. I suggest you try to work with their name or slug instead.
Related Posts:
- Dynamically exclude menu items from wp_nav_menu
- Add custom menu item using wp_nav_menu_items filter
- Custom search filter causes menu and query_posts problems
- Unregister Nav Menu from Child-Theme
- Allow html tags in WordPress Custom Menus Description Field
- Using filters to change href of nav menu page link
- How to apply a class to the second word in menu list item?
- WordPress nav_menu_link_attributes Not Working
- Is it possible to add a filter for the output of nav-menu items in admin?
- if role is logged in then do something
- Filter menu item to add classes/attributes?
- Edit html for menu items in default frontend menu
- Set Item Order with wp_nav_menu_{$menu->slug}_items
- When at / ( or “home”) my menu doesn’t get a current-menu-item class
- How to add parent element’s title to nav menu’s child?
- Why is ‘nav_menu_item_args’ filter’s $item argument empty?
- Add class to active element and its parent in nav menu
- display only the wp_nav_menu, which has the current-menu-item
- Removing strip_tags not working on nav_menu_description
- Third level navigation class
- How to add #navbar to all page links?
- add span to top level links of a wordpress menu called “main”
- Debugging – trying to add search box to menus
- wp_list_pages() but only show children on the branch you are on
- From a page, is it possible to find entry’s “menu_item_parent”?
- Add active class to top-level menu items when viewing single for that post type
- add_filter on menu items to add a menu item
- how to disable default menu classes
- Insert other menus as submenus of a main menu
- list category posts under its item in menu
- Prevent menu from loading in a page template [duplicate]
- Insert a div before the wp_nav_menu
- How to change menu structure?
- Secondary Navigation Menudisappeared When using wp_nav_menu_items
- remove specific classes from menu items
- wp_nav_menu action/filter help
- add_filter for where statment issue
- Add a counter beside menu item label
- Add custom link on the fly to nav menu
- menu-item class missing on wordpress menu
- Filter to hook into menu items and add a custom attribute
- if role is logged in then do something
- Possible to append class to nav menu added to widget area?
- Modifying Woocommerce menu based on tags and categories
- Why does WordPress convert absolute URLs to relative URLs for menu items?
- Add Featured Image and Title to wp_nav_menu items
- Show thumbnail to category items in wp_nav_menu(), how?
- Add Class to Custom Menu Widget ul
- Avoid changing menu query with suppress_filters => false
- Removing menu item doesn’t get removed on edit post
- Add Protocol to Custom Menus
- How to modify menu text in callback function of ‘walker_nav_menu_start_el’ hook
- Why is WordPress stripping anchor links from mneu item URLs?
- Add button and title on submenu WordPress
- In WordPress, I want to use code to filter out one menu item (page) from displaying when I call wp_nav_menu() function
- How to Add to Each Menu Link with link text to data-attr?
- How to manually specify the current active page with wp_nav_menu()
- Add a .last class to the last in each ul.sub-menu
- Show menu item description with line breaks
- Remove/Disable “Automatically add new top-level pages to this menu”
- How to retrieve depth of menu into template
- WordPress nav_menu_css_class theme filter is not being called
- Show link to add menu
- Change HTML structure for custom menu in sidebar
- Highlight current category, when using get_categories
- Menus like a CMS
- Hide menu item in certain condition
- Get top items number from wordpress menu
- Can I insert elements anywhere into the results of wp_nav_menu()?
- wp_nav_menu() with multiple Class
- burger on mobile
- Hierarchical menu nesting problem with jQuery targetting
- 2 Different Nav Menus Have Same Name in WP-Admin
- Creating a Mega Menu
- register_nav_menus() won’t register menus
- 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]
- How to align last 3 menu items to the right – WordPress main menu [closed]
- WordPress Menu Exchange On Tablet’s Orientation
- How to hide the menu item created by the theme in WordPress admin panel?
- how to insert data in li tag of navigation
- WordPress Login/Logout Single Menu Only
- If child is active add class to parent in customWalker
- 500 Internal Server Error when Trying to Save Menu [closed]
- plus sign not working in widget “Header: Nav Menu”
- Do not hyperlink menu heading
- Replace the page url with a menu link?
- 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?
- How to apply individual menu item’s “CSS Classes” to , not ?
- Output existing wp_nav_menu with a custom walker
- Product categories are mixed when creating menu
- Add a menu item to the logged in users author page?
- Remove link from Page name in navigation bar
- Setting up menus before making a template live
- Is it possible to add a superscript trademark symbol to a menu?
- Creating a Horizontal menu
- I want my homepage navbar to have different styling to the rest of my site, how can I do this?
- I need to change the hyperlink attached to the logo on the mobile menu
- How to add toggle-able DOM element after nav menu item?