If you set option ‘theme_location’ => ‘primary’ you need to be sure that you have registered this menu by the code in functions.php :
register_nav_menu( 'primary', 'Primary Menu' );
And then you need to be sure that you set Primary Menu in Theme Locations here: /wp-admin/nav-menus.php
Otherwise, wordpress will call fallback function which is wp_page_menu with default options.
And if you remove ‘theme_location’ option you will get menu which you set in “menu” оption (in your case, menu with name “nav-menu”). If this menu does not exists, wordpress will show first created menu.
If you didn’t create any custom menu – wordpress will call fallback.
Related Posts:
- Error: Declaration of MyClass::start_lvl() should be compatible with that of Walker_Nav_Menu::start_lvl()
- Is there an easy way to replace a custom menu link with a page or post?
- Why do Custom Nav Menus generate so many classes on list items? Can I manage this somehow?
- Using nonce in menu item
- remove last separator?
- How show sub menu only using wp_nav_menu()
- WordPress built in breadcrumb trail menu?
- Custom Nav Walker menu – Display children count
- How to add menu to Dashboard that can be viewed by all users
- WordPress Export Import Site Navigation Menu
- List children of second level sub page
- Bar separated navigation by extending Walker_Nav_Menu
- show only a given level in nav menu
- Custom menus created but does not show up in admin panel
- Replace menu tag with tag
- How to display custom post meta in the appearance->menus page
- wp_nav_menu custom walker – child items
- Adding menu items dynamically using wp_nav_menu_objects
- BuddyPress – How to add logout in nav menu
- Where do custom menus get constructed?
- How to remove div container in custom menu?
- Does loading of sub pages in menu cause load to the server?
- Get admin menu link
- How can I access the menu ID of an element in a WordPress Nav_Walker
- How to translate menu items?
- echo same menu items across multi-site platform
- Custom Menu url is Empty
- Add media library items to Menus using the Customizer (via Media Manager not URL)
- Add active class to top-level menu items when viewing single for that post type
- How to use buttons elements for tgetWordPress menu items?
- Static page to one page- menu inactive items highlighted
- automatically append menu parent as first item in submenu with nav_walker
- Add active class to ul container menu
- Help with walker for nav
- API for wp menu hacks
- wp_list_pages sort order by custom nav menu order
- Prevent menu from loading in a page template [duplicate]
- How to use wp_nav_menu with hashtag links?
- Rename menu items for All except super admin
- Displaying Nav Menu
- Adding toggle-able element after menu item
- Get Menus In Header.php FIle
- Custom register_taxonomy ins’t showing custom Nav menu
- Conditional menus based on page title
- How to test if a specific page is the front page?
- login logout menu changes in wordpress [closed]
- Style wp_link_pages as a select drop down list
- Menu deletes all items and position – wordpress bug?
- Mobile navigation is shown, but standard navigation does not disappear
- Plugins & Setting Menu Items Removed From Admin Panel
- Responsive menu on genesis theme [closed]
- Question about Menus on WordPress
- How to add active class to separate page link?
- Controlling sub-menu within sub-menu
- Main menu navigation links and new pages
- How are methods of class Walker_Nav_Menu invoked?
- Duplicate menu items when auto generating menu from product categories
- Using menus to link to sections on the home page
- Multisite: menus can’t be added in child sites
- How to get the Page Name of the current page?
- Add/remove image from navigation bar
- Swap out a page that is a parent to a many many pages
- How can I order these pages in this navigation bar on this old wordpress theme?
- Is it possible to remove the highlighted menu on Users and highlight a different menu?
- Modifying Woocommerce menu based on tags and categories
- How To add this tag before drop-down ul. in wordpress
- Unable to get Navigation Menu to display in the desired location
- WordPress theme editor not showing
- Add href to tag in nav menu for mobile
- How to change navwalker’s dropdown mark-up?
- Bootstrap navbar responsiveness on WordPress theme menu not working
- Creating custom vertical menu
- Enable identical menu on network sites
- Custom location for menu
- No indication of menu
- Adding a menu item to the main menu
- wp_is_mobile() inside js
- Adding two same css class on menu item
- How to select single category in menu if post have two categories?
- menu is only pulling in one item
- Any reason why widgets/menus get emptied when I updated custom theme code?
- Add items to a menu
- How to get current menu item “CSS Classes” value?
- How to change page location in WordPress
- Use menu structure for permalinks
- Set menu item class into body
- how to keep theme background image, menu or site header image while moving site in sub directory?
- List WordPress Custom Menu’s active parent level’s children as separate menu
- Unable to edit Navigation bar
- Editor user only allow to post on certain categories
- Menu Underline shows without Hover after adding subitems
- Add class to current category menu item
- How to create a custom WordPress navigation menu?
- Should I custom code drop down menus or use a wordpress plugin?
- How to load css file in my menu in wordpress
- Navigation menu, remove item from desktop
- Jquery dropdown menus working locally, but not in WordPress [duplicate]
- Wrapping my ‘s with
- child theme font awesome icons not working
- add dynamic ID for wp_nav_menu after and before