If you want to display a custom menu, you need to use the wp_nav_menu function. I’m also assuming you have registered a custom menu with the register_nav_menus function eg:
register_nav_menus(
array(
'main-menu' => 'Main Menu',
)
);
A basic example would be
wp_nav_menu(array(
'menu' => 'Main Menu',
'theme_location' => 'main-menu',
'container' => 'nav',
));
Change theme_location
to match whatever you set in register_nav_menus
.
Related Posts:
- 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
- WordPress Menu Custom Walker Class
- How to use a WordPress’ existing admin icon?
- How to move parent li to end of child ul
- Show child pages by menu order using Superfish Dropdown menu?
- 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?
- Can you have different menus and theme on a per-page basis?
- Adding a within ‘s from wp_nav_menu()
- 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
- jQuery cookie not working properly in wordpress
- Loop through Navbar, Output Icons
- Custom Walker anchor tag not inheriting attributes
- Check what “type” a menu item is
- Automatically generated menu
- next_post_link() on custom menu structure
- Admin only menu/page
- wp_nav_menu() showing list in a different Position?
- wp_nav_menu_items filter :: custom menus fall outside ul class
- 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
- How can I add items to the menu via the PHP file?
- WordPress warning: “private_to_published” Deprecated when creating nav with wp_update_nav_menu_item()
- two different separate sections on the same site
- Getting the current menu item id from specific menu
- how to disable default menu classes
- Adding an admin menu page showing the link twice – how to solve this?
- How to customize submenus isn wordpress theme [closed]
- Can I have a different menu for each parent page?
- Conditional menu display
- 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
- Wrap list parent in div with wp_nav_menu menu
- How to align last 3 menu items to the right – WordPress main menu [closed]
- WordPress Menu Exchange On Tablet’s Orientation
- How to add a element with walker menu right after begin of the navigation tags?
- Using front-page.php need new blog page
- Increase wordpress menu Depth
- How to hide the menu item created by the theme in WordPress admin panel?
- Custom menu walker – remove li tag based on class name
- Hide pages from the main menu
- How to customize the built in menu in wordpress?
- how to insert data in li tag of navigation
- Current author archive in navigation menu
- Adding CSS-class to WordPress Menu in backend
- WordPress Login/Logout Single Menu Only
- If child is active add class to parent in customWalker
- How to get or know the slug of home.php
- Set first level items to in wp_nav_menu()
- Difficulties filtering manage_nav-menus_columns
- How to create menu spread over four lines including images
- 500 Internal Server Error when Trying to Save Menu [closed]
- plus sign not working in widget “Header: Nav Menu”
- Do not hyperlink menu heading
- WordPress menu items automatically becoming empty custom links
- Help with WordPress Custom Nav Walker
- Replace the page url with a menu link?
- Cannot collapse a responsive menu in WordPress
- Change hover to onclick on menu
- How can I get back the content of a sub-menu
- Only the index.php/homepage open while other pages are not opening
- Why my dropdown menu is effecting main menu?
- Does the Default theme of WordPress like 2016, 2017 and 2019 uses Walker_Nav_Menu Class
- WordPress Menu Navigation links not working
- Where to place a svg chevron down in my custom walker?
- How to apply individual menu item’s “CSS Classes” to , not ?
- Display_name in menu
- Output existing wp_nav_menu with a custom walker
- How to access into the description of a sub menu
- Adding span to a particular text in an menu item
- How can I create this menu with wp_nav_menu()?
- Get Sub-Menu Dropdown to Show Over Page Content
- Foundation Scripts not loading (custom theme)
- How to Add Class in
- How to know which menu trigger a link?
- Menu Details Output in Javascript [closed]
- How to get the title of root li element
- Avoid changing menu query with suppress_filters => false
- Get menu items problem
- Can’t add any menu items anymore, server related
- jQuery not working when used with wordpress menu
- How to display list of child pages with parent in wordpress?
- Show content of subdomain from specific menu-item?
- wp_nav_menu – Collapse with PHP
- How can I disable sorting/dragging of a menu item in the custom menu admin?
- 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?
- Menu problem : when add wordpress element in menu it convert into empty custom link