The keys for the array passed to register_nav_menus()
should correspond with the 'theme_location'
arguments in your calls to wp_nav_menu()
. Since they do not, WordPress is unable to locate the appropriate menu and displays a default consisting of all top-level pages instead.
Either change your 'theme_location'
arguments to 'menu-1'
and 'menu-2'
or change the array keys in your register_nav_menus()
call to 'primary'
and 'secondary'
.
Related Posts:
- How to modify mobile nav menu text in theme
- Why in this WordPress theme I can’t see the Main Menu?
- Remove the Tag from wp_nav_menu
- WordPress navigation wont appear with wp_head
- Mega Menu Walker
- Displaying Logged-In User Name in WordPress Menu
- Hide a menu-item and its submenus and display a ‘Log in’ link if the user is logged out
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- How can I add a class to a single menu item?
- Logout and redirect using the WP Menu
- Second Navigation inside header
- How can I add a custom class to only nav sub-menu > li > a items in WordPress?
- items_wrap not working
- Style wp_page_menu() items
- custom shortcode will not display the wrapped content
- Change Navigation Bar based on logged in or not
- Hide Hamburger Menu On Specific Page (Front Page/Home Page)
- Menu Limitations
- Custom Walker_Nav_Menu issue with variables on PHP 7.3
- Detecting classes, adding widgets, and adding divs in with a Nav Walker
- How to style one item from main navigation?
- Show About and Contact Us page when they’re clicked in the top menu.
- Add login hyperlink to secondary navigation menu
- wp_nav_menu not working correctly in my underscores theme
- Menu Custom Data Attributes
- Output only links using wp_nav_menu()
- Get css class of menu item in custom menu structure
- How to add aria role and schema markup to custom walker container
- Nav-Menu not showing up
- Custom navigation menu with awsAccordion
- How to correctly load a different version of main menu based on the user language in WordPress? Is it a good solution?
- Why can’t I add a custom image in my navigation?
- How to tell if a user has gone in and created a menu
- How to set Nav as a default menu in wordpress
- Redirect User when they click Menu Option
- PHP code printed into CSS classes
- How to create a sub-page of sub-page?
- Problems with the WordPress loop [closed]
- Add the “.current-menu-item” class to tag?
- Nav Menu Display
- Open WordPress Page from selected option dropdown
- Custom Navigation Bar JSON Syntax Error in JSON at Position 0
- Nav menù doesn’t display selected pages
- PHP unit testing WordPress?
- renaming an admin menu item with decimal array index number
- HTML Bootstrap navigation menu to WordPress menu using wp_nav_menu
- Return only top-level navigation items from a menu using wp_get_nav_menu_items
- Multiple do_shortcode($content) within one shortcode
- Replacing the NavWalker dropdown element
- How to add specific menu on a specific page or pages
- WordPress menu deletes when trying to add a hook
- Widgets not showing in my custom theme
- selected menu item
- What is the fastest way to load PHP functions that are only used in one theme template?
- Can’t load WP function into external function
- Implement toggle switch for theme options in settings API
- Show comments menu in dashboard only if the site has comment
- Trouble creating conditional PHP for nav menu items with children for custom Walker
- Count top level menu items
- Theme Options Page – User Updates Logo
- Two queries for a WP_User_Query search work perfectly apart, but not together
- Secondary navigation menu on one page
- Remove class in nav_menu_link_attibutes filter
- WordPress Quick Question . How to Get Parent Link in Submenu in My Code
- How to edit widget code to add unique class name to each div?
- Is the “_s” on this `sprintf(__(‘Page %s’, ‘_s’), max($paged, $page))` just refer to a text domain?
- Adding PHP in the menu
- Syntax error when I try to insert my loop into an unordered list? [closed]
- What exactly do this function declared into functions.php file of a WP theme?
- Royalty-Free Sliders used in theme development
- Reason to add a name of the theme like (‘menu-1’ => __( ‘Primary’, ‘twentynineteen’ ),) in PHP?
- zip unzip attachments in wordpress
- WordPress get_media_embedded
- get_comments_number() returns 0
- how do i develop a global nav and local nav to be wordpress dynamic?
- Posts are not looping through correctly
- Adding Additional Variables on Menus Page
- Why the dynamic_sidebar() call is putted into an ul tag?
- Class for Selected Menu using wp_nav_menu
- Remove Custom Post Category In WordPress Slug Using .Htaccess
- Uncaught TypeError: extract(): Argument #1 ($array) must be of type array, null given
- Header is not displaying on certain pages of wordpress theme [closed]
- Featured image in menu wordpres
- I want to show cart items number if any or nothing, simple CART text
- Looping through dummy posts and showing them in the main index.php
- PHP warning with code for nav menu walker [duplicate]
- String replace for Login/Logout concatenation problem in menu
- Customizer: How to Sanitize a Decimal Number Range
- Get the image title and alt from custom query
- What syntax is this? “{{post.price}}”
- Custom Thumbnails [closed]
- Retrieving specific images from Media Library
- WordPress get_post_meta issue
- How to add button to top of theme customizer?
- Submenu opened problem
- Sidebar doesnt get updated?
- ACF | WooCommerce | Theme Development | How to include a /template-part/ that makes use of ACF’s on a custom WooCommerce homepage?
- Predefine Magazine Style Layouts
- Twig+WordPress how to use array arguments inside a function?
- Woocommerce Convert existing order to the cart