You need to move return $items;
outside of the if
check. Currently, you are only returning menu items when the theme location is primary
, all other menus will have no menu items if you return nothing for those.
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?
- 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?
- Menu location switcher – example code fails
- 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
- Why do Custom Nav Menus generate so many classes on list items? Can I manage this somehow?
- How do I add nested categories to drop-down menu in twenty-eleven?
- Add custom page link with anchor
- Show top-level parent with submenu menu walker
- Add section to custom menu panel
- Highlight the “Home” / “Blog” button while on main page
- how to add Custom menu item like User name in Header Menu only
- Display three different levels of navigation from wp_nav_menu separately?
- Menus – Open items in new tab/window?
- Highlight another nav item
- Get category ID from nav menu
- Programmatically add existing pages and subpages to Appearance Menu
- Highlight current post ancestor parent menu items
- Ad custom admin page like WordPress customizer [closed]
- Appearance Menus Screen – menu item drop down menu not functioning
- Weird behaviour on Edit Menus screen
- Make a navigation menu in the same post [duplicate]
- Add item to top of menu using a filter in functions.php
- How to actually make menu walker alive on admin interface?
- Trying to add a custom social icon to a Twenty Twenty-One child theme
- WP admin style not refreshing
- Navigation menu not visible (contrast issue) on home page
- Tageting a specific menu link with nav_menu_css_class
- functions.php adding item to end of menu. I want to change position
- Custom Menu Anchor Links Not Working
- Switching to child theme breaks menu names
- Bootstrap menu – make menu entries with submenu not clickable
- How to change the navigation menu
- Menu links URL with PHP GET method
- WordPress nav_menu items from another menu appearing
- Adding widget to sidebar which contains current page’s submenu
- WordPress theme editor not showing
- How to switch menu location in this header.php?
- Extending Walker_Nav_Menu in wp_nav_menu List of Empty Items
- Jump to section on another page from menu item
- Users are required to login to my site. How define user.member boolean, its permissions, and conditionally display/handle behavior based on it
- How to Use Default Auto-Generated Menu?
- Two questions about CSSing inside the menus
- Add items to a menu
- Add tooltips with image in WordPress Menu?
- How to make a drop down menu with categories
- How to use my custom menus as seperate pages?
- WordPress wp get nav menu items does not deliver external link
- Site pages show the page title under navigation bar
- What is the best way to incorporate responsive dropdown navigation menu into custom theme?
- Submenu items not working anymore