Enabling a menu in your theme
As of WordPress 3, users can now control more easily what appears in menus. Instead of having to show all the pages in the menu, you can choose to show a selection of pages, and/or categories, and/or other options (as we saw in Chapter 4, Pages, Menus, Media Library, and More).
The good news I have for you right now is that menus are already enabled in the structure of the theme we're creating here. Because we used the wp_nav_menu()
function in the header of the site (in the file header.php
), if the user creates a menu in Appearance | Menus and then assigns it to the area indicated as primary
, it will show up in that spot. The same goes for the other menu area, footer_menu
, which is placed in the footer.
If you want to have more than one navigation menu in your theme, you can register multiple navigation menu locations and let the user create multiple menus and choose which menu goes in which location. To learn more about that, check out this page of the codex...