By specifying a theme_location
argument in my array, the issue was fixed:
wp_nav_menu(array(
'theme_location' => 'main_menu'
));
Edit
For a distributed Theme, do not pass the 'menu'
parameter to the wp_nav_menu()
call. It will look for a specific slug of a user-created menu, and will override 'theme_location'
. Only ever pass 'theme_location'
.
Related Posts:
- Display a portion/ branch of the menu tree using wp_nav_menu()
- Dynamically exclude menu items from wp_nav_menu
- Display only page specific sub menu items using Custom Walker
- adding some custom html code to the wp_nav_menu function
- non-clickable placeholder in the menu
- How to Move the Author Metabox into the “Publish” metabox?
- How do you get the current-menu-item ID?
- How do I give class to the dropdown sub-menu in the wp_nav_menu?
- Ways to give a wp_list_pages menu link specific class names?
- I want remove last after wp_nav_menu
- Add log in link to menu in Twenty Twelve
- rename navigation menu label in wordpress theme by code
- wp_list_pages – show pages immediately 1 level below current level
- Add within the output of
- how to automatically generate hierarchical menus from hierarchy of pages?
- Add sidebars to navigation menu?
- Where to update the Static Pages Blacklist for Multisite Install?
- How to create a category menu?
- Adding a ‘mega menu’ to my site without a plugin
- Vertical Sidebar Menu Parent and Child not displaying correctly [closed]
- Hide Menu items base on capability
- How to show Home Page link in WordPress Menu and how to add an icon to this?
- Remove li from wp_nav_menu
- I am facing a problem with the navigation menu of my website
- How do you return a menu with the menu name?
- do_action appearing outside of menu?
- two menus show different menu based on what menuitem is selected on menu1
- Appending a GET-Variable to wp_nav_menu
- You do not have permission to create Navigation Menus – Twenty Twenty-Two theme
- Walker class conditional based on parent menu item label or custom css class
- ‘wp_get_nav_menu_items’, when fired inside of the ‘wp_update_nav_menu’ hook, returns old menu items, instead of new
- Menu custom link not working for external site
- How to override the theme home page?
- custom walker class
- Sticky Header in WordPress using BootstrapWP theme [closed]
- Walker Class – Check if menu item has description and if so add class to li
- Multiple languages menus problem
- Displaying different page links on different pages
- One item not showing when programmatically Generating Navigation Menu
- register_nav_menus, then create menus programatically
- How to override menu markup?
- How to remove dropdown from wp_nav_menu
- How can template identify what page it’s being used on?
- How to make wordpress nav menu use post custom meta data
- Is it possible to make the heading on a page different text to the text of the menu item?
- How to Structure Pages and Subpages
- Add extra menu to theme
- How to list only root pages?
- Page menu with one image link instead of page title?
- Add custom path to url to specific pages
- CTA button that is only visible to some of my users
- Search if menu item has child in wp_get_nav_menu_items hook
- add another html tag after li element in wp_nav_menu
- How to customize navigation menu in theme which is converted from pure html theme
- How do I change/remove styling (top border) on main menu for active page and hovering (Avada Theme)
- WP nav menu + Bootstrap, add role=”menu” to UL
- Custom HTML output for registered navigation
- how to set the link in wordpress such that on clicking it doesn’t open another page but go to the bottom of same page
- custom walker class for own menu?
- 2 item in a same menu pointing to 1 page
- Add a menu metabox to post edit page
- Setting or plugin for showing submenus horizontally under the main menu, and keep them after selection
- New wp menu menu styling
- (Mobile) Hamburger menu disappeared from a page (only one)
- How do I make it so a post only shows in its category archive but not the home page?
- Hiding menu on specific pages
- Bootstrap Menu bar shows up a toggle in Desktop Mode
- Mobile menu displays submenus on top of parent. Need it to display right below on an own line
- For a menu custom link (without a link) a “#” is appended. Can this just be blank, i.e. NO link?
- sidebar navigation problem with child pages not all display.?
- How to point menu to my homepage
- save_post() on Menu Save
- code to add an extra selection to the menu editor
- Highlight inner post menu current item
- update_post_meta breaking wp_update_nav_menu_item
- Menu dropdown disapears behind slider
- Generate Submenu based on Parent Page using If Statement
- Building a menu from a large number of pages?
- how to change single post link
- Any simple way to show 10 previous pages by id to current page in links as a menu
- Vertical Menu items shifting to same line when window size increased [closed]
- Pass $item->description to start_lvl
- Menu on responsive twentytwelve theme not working, strange url error
- How do I remove a menu from a theme?
- Access CSS Classes specified in Menu options
- Query for menus in backend (BE)
- How to output the menue structured for tabbed navigation?
- Add more levels to menu
- Custom Menu based off custom header
- WordPress Navigation
- Showing Custom Menus in the sidebar
- Adding an additional menu in WordPress
- How to set up suhosin.ini for unlimited menus
- Making current_page_item work with wp_list_pages in sidebar on post pages
- My Menu Disappears on my Custom Link Homepage on Mobile
- How to centre menu items on horizontal nav bar? (e.g. make margins equal) [closed]
- Display sub menus as separate lists
- Sub menu for a (single) page
- Add acf custom fields so sub item in menus
- change breakpoint widths for divi theme tablet view