Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress WordPress Theme Development Building Out WordPress Navigation The wp_nav_menu Function

Registering a Menu in WordPress

Hey,

So I don't understand the idea of registering a menu in Wordpress. What does registering it mean?

I get that when you want a menu to display somewhere, you use the wp_nav_menu function, and add_theme_support('menus') allows you to use custom menus in your themes. But the idea of registering a menu makes no sense to me.

1 Answer

Registering a menu area is the same as registering a widget area. It basically tells wordpress " Hey look here, my name is primary Nav, if someone is looking for me, I'm here"

Then on the backend, when you go to the menu page, you can assign a menu to that location. sometimes you may have sidebar navigations that wont be in widgets, or utility navs that go above a main navigation. Its for those times that we need to register more menus.