Along with pages and custom links, you can use the navigation screen to provide links to categories you define for your content. Let's do it!
Can't see the Resources category?
If you can't see one of your categories in the Menus screen, that's because you haven't assigned it to any posts yet. WordPress doesn't let you add empty categories to your menu as that wouldn't be very helpful to users. Simply assign that category to one of your posts and it will show up in the Menus screen, and if you need to leave the Menus screen to do this, make sure you save your menu first.
We created a new WordPress menu in the Menus admin screen, told WordPress to display it in our theme and added some links to it.
The WordPress Menus screen gives us even more functionality than we've used here. Let's have a look at some of the possibilities.
WordPress lets you set up your menus in a variety of ways and with a lot of flexibility. You can add any links you like, call them whatever you want, and structure your menu however you need.
Firstly, you can add different types of links to your menu:
Once you've added your links, you can give them a custom navigation label, which doesn't have to be the name of the page or post linked to. So if you wanted to link to a post with a long name you could use an abbreviated label in the navigation menu. You do this by clicking on the arrow next to the label's name in your menu and typing text into the Navigation Label field:
As well as this, you can change the structure of your menu by adding second level links, which will be output as a <ul>
tag inside your top level <li>
tag. You do this by dragging the link to the right underneath the link you want it to appear below. This is great for drop-down menus in larger sites. The following screenshot shows how this looks in the Menus admin screen:
And here's the effect in our theme:
As you can see it doesn't quite work in this theme as we haven't added any styling for second level navigation links, but a bit of CSS would soon fix that. We'll undo this and make the menu all one level again to fit with our design.