
If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!
The second level navigation is by far the easiest, tried and tested method of the three. Section 3.1 will cover the second level menu coding and it’s usage.
To add these second level navigation, we simple use the tags that generate a string of categories (or archives) and place them beneath the main navigation menu and style appropriately.
For example, to add a list of categories below the main menu, add the following code in the header.php (assuming your main menu is in the header):
Note: the hide_empty tag unhides or hides unused categories.
Where to place the tag? Right below the template tag for page as described in the example below.
If we revisit the theme we created from the last exercise you will note that the main menu is displayed in the header in a single row.The code for this menu (simplified) looks like below:
We will add the category code below it to generate the second layer menu. The code to add will look something like this:
To easily style this second level, use the existing style for the main menu and make minor changes to the display (colors and such). In this case, we will enclose this second level in a div called “subwrap submenu”, the main menu is within a div called “wrap menu”.
November 6th, 2008 at 2:15 pm
[...] will use the same demo theme we created during the previous tutorial. As you can see it has conditional page tags built in, just like many of our other new [...]
September 16th, 2008 at 10:38 pm
brilliant. So simple and easy, and explained well. So, I expect the conditional explanation involves how to target related pages? Looking forward to more.
September 1st, 2008 at 7:17 pm
[...] Part 3.1 — Navigation – Second Lavel Menu [...]