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 primary
in 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
- Display only page specific sub menu items using Custom Walker
- non-clickable placeholder in the menu
- Ways to give a wp_list_pages menu link specific class names?
- I want remove last after wp_nav_menu
- Add log in link to menu in Twenty Twelve
- wp_list_pages – show pages immediately 1 level below current level
- Where to update the Static Pages Blacklist for Multisite Install?
- Vertical Sidebar Menu Parent and Child not displaying correctly [closed]
- Hide Menu items base on capability
- How to show Home Page link in WordPress Menu and how to add an icon to this?
- Remove li from wp_nav_menu
- Run a filter when a walker runs
- How do you return a menu with the menu name?
- do_action appearing outside of menu?
- You do not have permission to create Navigation Menus – Twenty Twenty-Two theme
- Walker class conditional based on parent menu item label or custom css class
- ‘wp_get_nav_menu_items’, when fired inside of the ‘wp_update_nav_menu’ hook, returns old menu items, instead of new
- Menu custom link not working for external site
- Walker Class – Check if menu item has description and if so add class to li
- Multiple languages menus problem
- How to override menu markup?
- How to remove dropdown from wp_nav_menu
- Static site menu with multiple ul’s to wp menu
- How can I make wp_nav_menu() support tags?
- Adding a tag to wp_nav_menu
- Adding Pipes to Menu Output
- select a main navigation menu per user type from multiple main navigation menus
- wp_nav_menu li item empty
- Custom Menu in Themes not working even in Twenty Eleven theme
- Determining the “current_page” in WordPress Custom Menus
- cannot get global $menu value in form request
- Show Sub Menu on click and not hover
- WordPress menu walker – help to add custom class for each submenu
- What is inside in $item in start_el function in Walker_Nav_Menu class
- choose selected for select option with condition [closed]
- wp_update_nav_menu also triggers post_updated
- Disable Top Nav Bar on Mobile
- Building a menu from a large number of pages?
- how to change single post link
- How do I remove a menu from a theme?
- Access CSS Classes specified in Menu options
- How to output the menue structured for tabbed navigation?
- Custom Menu based off custom header
- Adding an additional menu in WordPress
- Making current_page_item work with wp_list_pages in sidebar on post pages
- How to centre menu items on horizontal nav bar? (e.g. make margins equal) [closed]