In my function:
register_nav_menus(
array(
'menu-1' => esc_html__( 'Primary', 'mySite' ),
'menu-2' => esc_html__( 'Secondary Menu', 'mySite' ),
)
);
And then in my header to display the menu:
<?php
wp_nav_menu(
array(
'theme_location' => 'menu-1',
'menu_id' => 'primary-menu',
)
);
?>
Related Posts:
- 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 get IDs for objects in menu branch?
- New post notification in wp_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
- One site, 2 distinct sections: two different top nav menus?
- 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
- Display link with current user’s username in it in Custom Menu
- Walker_Nav_Menu: Items not nested correctly
- Add class to menu ul with active child
- Loop through Navbar, Output Icons
- Custom Walker anchor tag not inheriting attributes
- Check what “type” a menu item is
- 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
- Add within the output of
- Add CSS to head depending on nav menu walker
- WP MU: Using pages from main site in other sites’ menus
- Can only get one of two custom menus to display
- wp_nav_menu not working [closed]
- two different separate sections on the same site
- Getting the current menu item id from specific menu
- how to disable default menu classes
- How should I build a custom menu walker for this setup?
- Adding an admin menu page showing the link twice – how to solve this?
- How to customize submenus isn wordpress theme [closed]
- Dynamic_sidebar inside wp_nav_menu
- Can I have a different menu for each parent page?
- 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]
- Combine 2 categories in one Menu item
- How to align last 3 menu items to the right – WordPress main menu [closed]
- WordPress Menu Exchange On Tablet’s Orientation
- changing theme folder name breaks menus – twentyeleven
- Submenu in sidebar custom page template
- How to add a second custom menu in my sidebar when theme only supports one?
- add_filter for where statment issue
- How to hide the menu item created by the theme in WordPress admin panel?
- Custom menu walker – remove li tag based on class name
- How to add columns to wordpress menu editor
- how to insert data in li tag of navigation
- Removing a page from the header menu
- WordPress Login/Logout Single Menu Only
- wp_nav_menu does not take arguments?
- “Widgets” menu doesn’t appear
- WordPress always display the first menu
- If child is active add class to parent in customWalker
- Set first level items to in wp_nav_menu()
- 500 Internal Server Error when Trying to Save Menu [closed]
- plus sign not working in widget “Header: Nav Menu”
- Do not hyperlink menu heading
- How do I convert a custom menu wp_get_nav_menu_items into Fourth level?
- Hide a menu (navigation bar) on all posts
- Adding menu title to custum URL
- Parent Menu Item Requires Two Clicks for Mobile Device
- Is it possible to have submenu outside of menu element? I dont want submenu to be a child of menu
- Product categories are mixed when creating menu
- Header lists posts instead of showing primary nav menu
- Add a menu item to the logged in users author page?
- Add Class to Custom Menu Widget ul
- Add parent link to its submenu
- Iterate through each menu item into a shortcode
- Loading wordpress menu in an external server
- “Static” Child Menu with Accordian
- Need direction on a seemingly complex menu walker for automatically inserting a parent link li in it’s submenu ul
- Image menu on responsive WordPress
- Set a different home link in nav menu
- Remove link from Page name in navigation bar
- Prevent Menu Shortcode From Formatting
- individual images as navigation design TwentyTen
- Auto Filled Custom Menus for Custom Post Types?
- Setting up menus before making a template live
- Adding Pages to Menus – No Page Hierarchy in Backend [duplicate]
- 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?
- Problems with draft website pages
- register_nav_menus and wp_nav_menu issue, not displaying independent menus
- Convert a custom bootsrap based menu to wordpress nav walker
- How do I get the menu items based on name or ID?
- Menu problem : when add wordpress element in menu it convert into empty custom link
- Problems with the navigation menu