WordPress Nav Menu Functions

Beginner
5 min read
Updated: Nov 2026
2 function guides
Function index

About This Index

This page is the WordPress Nav Menu Functions index. Each row links to a full guide with syntax, three examples, and FAQs.

Learn the big picture on WordPress Nav Menus. Use this page when you need one function, such as wp_nav_menu() or walk_nav_menu_tree().

Remember.

You build a menu in Appearance > Menus, and you show it with wp_nav_menu(). walk_nav_menu_tree() is a helper behind the scenes, and you only call it for custom menu HTML.

How to Call a Nav Menu Function

Register a location once, then show it in your theme.

WordPress
<?php
// functions.php: register the location.
register_nav_menus( array( 'primary' => 'Primary Menu' ) );

// header.php: show the menu assigned to it.
wp_nav_menu( array( 'theme_location' => 'primary' ) );

WordPress Nav Menu Functions Table

All function guides in this WordPress nav menu series (2 tutorials). Start with wp_nav_menu().

Display a Menu

1 function

Show a menu you built in Appearance > Menus.

FunctionDescriptionTutorial
wp_nav_menu()Display a navigation menu for a theme location, with options for the wrapper, classes, and fallback.Read guide

Build Menu HTML

1 function

Make menu HTML from menu items with a Walker. This is for advanced custom output.

FunctionDescriptionTutorial
walk_nav_menu_tree()Walk a list of menu items with a Walker and return the HTML list items as a string.Read guide

Frequently Asked Questions

They are functions that show a navigation menu in your theme and build the HTML for its items.
Use wp_nav_menu(). Register a location with register_nav_menus(), assign a menu in Appearance > Menus, and then call wp_nav_menu() with theme_location.
Rarely. wp_nav_menu() calls it for you. Use it only when you build custom menu HTML from menu item objects, often with a custom walker.
It is a named place in your theme, such as primary or footer, where an admin can assign a menu.
No menu is assigned to the location, so wp_nav_menu() runs its fallback, wp_page_menu. Set fallback_cb to false to show nothing.
Start with wp_nav_menu(). Learn walk_nav_menu_tree() later, when you need a custom walker.

Start with wp_nav_menu()

Display a menu in your theme, with simple options.

wp_nav_menu() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful