To display a menu you need to use the wp_nav_menu
function (Codex reference).
Try changing your template file to use the following code:
<?php wp_nav_menu( array( 'theme_location' => 'main-menu' ) ); ?>
Related Posts:
- Add a #hash to the links in my custom menu
- How to add menù section to my WordPress template?
- Menu items description? Custom Walker for wp_nav_menu()
- How to add posts to custom menus?
- wp_nav_menu(), how to change class?
- Display Menu Name using wp_nav_menu
- What’s the difference between home.php and index.php?
- Custom single template for a specific category
- How can I display a menu on certain pages only?
- How to insert a logo in the header?
- Add custom classes to anchor in wp_nav_menu
- Add Caret to Menu Items with Sub-Menus in WordPress Theme
- How to limit wordpress menu depth in admin panel
- How to move page templates to custom folder?
- Page template in two level deep folder
- Is it possible to manipulate the list of page templates?
- wp_nav_menu sort order?
- How to determine if custom menu is active?
- How do I check if a menu exists?
- Different wordpress 404 template for different post type [duplicate]
- How to use logout function on custom menu link?
- How does WordPress decide what template to use as frontpage
- How can I get wp_head() as a string instead of echoing it?
- Any walker causes blank menu?
- Why does my short code get executed before other content?
- How to display wp_nav_menu() conditionally only when not on a 404 page?
- How to add menu support to a theme?
- Retrieve the template directory URI via global or get_template_directory_uri() every time?
- How can I see what template parts are being called for rendering the viewable page?
- Add a preview to a WordPress Control Panel
- Problem with registering menus – What to do when other solutions aren’t working?
- How can i change menu link when page content empty?
- Problems with Layout inherit in theme.json
- How to Handle CSS for Multiple Header header.php Files?
- How to load different CSS in different Header?
- Select menu on browser resize
- Static Front Page problem
- Extend walker – navigation, adding data attribute to a tag
- Returning Variables back into a template
- How to add (css) classes to only one wp_nav_menu()?
- Can not Remove Archives and Meta from Sidebar
- Get last modified date for menu link
- Replace Home with image link inside custom header menu
- How to override BuddyPress 3.0 bp-nouveau theme files?
- Displaying wp menus by name without using theme locations
- How to add nofollow to wp_nav_menu
- How to highlight the current page in the nav menu?
- How do I add a post to a menu
- how to change WordPress menu markup/classes
- Setting hero/splash section as a blog post
- Setting a Default ‘Theme Location’ When Creating a Menu
- WordPress nav_menu_css_class theme filter is not being called
- Where is the correct place(s) in twentysixteen’s header.php to add a Google webfont?
- How to retrieve an image from a post and display it before excerpt of a post? [duplicate]
- Best practices: Custom theme sidebar menu – hardcode or widget?
- How do I highlight the menu for a child page?
- Custom Nav Walker Displaying Values in Sub Menu
- Any tag pagination page (except the 1st page) loads index.php template instead of tag.php
- how to set more than one menus to the same theme location
- How do I update WooCommerce template files in my theme? [closed]
- Custom Nav Walker to show siblings and children of current branch?
- CSS won’t style output of wp_nav_menu() correctly
- Create self-populating menu and add extra divs to the menu layout
- Where is definied the theme location for the main menu in a WordPress template?
- New template, where to place CSS?
- how to wrap tag in tag html to wordpress menu conversion
- Check if password protected post is visible
- get_query_var() and permalinks
- Second menu not showing
- How to remove class attributes from custom menu markup?
- What is the best way to handle multiple calls to get_template_directory_uri() and similar functions?
- Toggle Sidebar Display
- 2 differen’t menus and it’s using same items in both
- menu behavior is not as expected
- Add theme templates for child categories into the template hierarchy
- Move theme templates to subfolder without losing page associations
- Where can I access my custom page template?
- Theme development question regarding layouts
- Is there an action for save_menu and/or update_menu?
- Set default screen option for appearance -> menus
- Why are theme templates organized as multiple point of entry PHP files instead of reusing your theme’s index.php?
- Part of Menu Item Hidden on Header Menu
- WordPress Theme Development: How to redirect templates the right way?
- Disable front-page.php template
- How do I create a custom partial / template?
- Change the template of multiple multisite pages at the same time
- wp_nav_menu add something before closing container and after last list item
- Load child template based on parent
- Find the Children of a Page then Echo it as a Bulleted List of Links (menu)
- which is the best way to customize nav-menu-template.php?
- Create wordpress header with custom logo in between the menu splitting the menu into two equal parts [closed]
- create-guten-block in wordpress theme?
- WordPress navbar with logo in middle [closed]
- My Admin bar covers my sticky navbar [closed]
- Override template file i subfolders
- Single Page theme [closed]
- WordPress is adding margins and padding to my custom menu?
- Menu item added in wp_nav_menu_items filter is never highlighted
- wp_post->post_parent object returning 0
- WordPress empty Nav Menu error