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
- What is considered good practice for registering menu locations?
- Using php inside javascript [closed]
- Make next post button link to random post
- Show login greeting above sub-menu links?
- How can I assign separate stylesheets to different pages?
- Need advice on theme customizer and child themes
- How to make sure relative URL works when site is not on root domain?
- pass html code to worpdress
- Toolbar Hidden in a Virtual Page
- Remove submenu item from list
- conditional: if is page, and all subpages
- wp nav menu: show submenu below li item
- Dynamic Menu drops pages?
- Ajax URLs without #!, how to prevent falling into single.php on load or reload?
- Class for Selected Menu using wp_nav_menu
- Get options from database using php class
- Search.php gets metadata from first post
- Commas in Tag Cloud
- Trying to change featured image from 180×180 to full width on home page
- Menu not styling. New menus functionality giving me a headache
- Styling an “active” link outside of WordPress default menu
- Custom nav menu not showing
- How to create Loop code for Menu using WordPress?
- Hard-coding a shortcode as the last menu item in primary navigation?
- Dynamic menu with custom post types
- Adding a navigation page state to individual blog and portfolio pages
- security concerns if using html data-* attribute for l10n?
- Search AJAX Filters – Multiple Query Loops Into One Loop (Optimization)
- Displaying images outside the content
- Add class to ul and li in wp_na
- WordPress redirects page query parameter in URL
- Remove Custom Post Category In WordPress Slug Using .Htaccess
- For some time, some of my pages do not display the content anymore. Any idea where this could be coming from?
- Getting text from custom field from customizer
- How do you remove header sitewide from mobile only?
- Nav Walker that shows only children and siblings of top level parent menu item
- how to changes mobile menu toggle breakpoint in WordPress
- Dynamically switch file in get_template_directory_uri() | Function [closed]
- How to display already created menus via php?
- PHP inside echo HTML
- Need help for some PHP code
- How do you get the current post taxonomy so I can get the current post taxonomy? into a variable to THEN loop through all post with that taxonomy.,
- Uncaught TypeError: extract(): Argument #1 ($array) must be of type array, null given
- How do you create a custom category widget that you can style?
- How do I edit the terms output args or array data?
- Adding an Anchor Link to a wordpress menu using WPBakery Page Builder
- Providin exception to WordPress wp_nav_menu Custom CSS Classes
- In PHP how do I make my navigation bar show certain links to admins only?
- Header is not displaying on certain pages of wordpress theme [closed]
- How to extend SelectControl with data from my theme
- How to change basename url for wp-admin?
- Adding markup to sub menu based on class
- Featured image in menu wordpres
- how to replace h1 entry title with h2 in category pages only
- Bootstrap 4 Carosuel with ACF Repeater field
- How to make only the valid active page of a multilevel menu active with – “.nav li.current-menu-item a”?
- WordPress single.php get_header not working