Codex tools: Log in
This guide to the WordPress Menu system covers the basic tasks a user may carry out when using the built-in menu editor such as: Defining a menu, adding items to a menu, customising menu items using the 'Navigation Label’ and ‘Title Attribute’ options, deleting menu items and creating multi-level menus.
Contents |
You will have to define a menu before you can work on it. The steps below outline this process:
In this example, we’ll add 6 pages to the menu we created in the previous section. One of the pages added will point to the ‘Home’ page of the site. The steps you will need to take are listed below:
Before we jump to the example, a little explanation about the ‘Navigation Label’ and ‘Title Attribute’ options is needed.
The ‘Navigation Label’ option specifies the title of the menu item as it appears on the navigation menu. This is what your users will see displayed on the navigation menu when they visit your site/blog.
The Title Attribute’ option specifies the Alternative (or ‘Alt') text for the menu item. This is what will be displayed when a users’ mouse hovers over a menu item, or if the user is accessing the site using screen reader software, for example.
In the example for this section, we’ll be using the menu item titled ‘Another Test Page’. The ‘Navigation Label’ option will be given value of ‘Page 2’ and the 'Title Attribute’ value will be changed to a value of ‘Click here for Page 2’ The steps you will need to take are listed below:
The steps you will need to take are listed below:
When planning the structure of your menu, it helps to think of each menu item as a heading in a formal report document.
In a formal report, main section headings (Level 1 headings) are the nearest to the left of the page; sub-section headings (Level 2 headings) are indented slightly further to the right; any other subordinate headings (Level 3, 4, etc) within the same section are indented even further to the right of the page.
The WordPress menu editor allows you to create multi-level menus using a simple ‘drag and drop’ interface. You can drag menu items up or down to change their order of appearance in the menu, or you can drag them left or right in order to create a multi-level menu structure. To make one menu item a subordinate of another item, then position it underneath, and drag it slightly to the right of, the main menu item.
This section will build on the example menu used in the previous section. Currently the menu only consists of main menu (Level 1) items, as can been seen in the screenshot below:
So, with our report analogy in mind, the menu in this example will be re-structured as follows:
*Home *About *Page 2 *Child Page 1 *Child Page 2 *Level 1
In this example, the menu items ‘Home’, ’About, ‘Page 2’ and ‘Level 1’ will be the main menu (Level 1) items, while ‘Child Page 1’ and ‘Child Page 2’ will be sub-items, subordinate to ‘Page 2’
The steps you will need to take can be found below:
OK, you should be all done with creating the menu now. If the theme you use supports WordPress menus (in this example I’m using the Twenty Ten theme, which does include menu support) then you should only see the four main (Level 1) options.
The two sub-menu (Level 2) items created in the example should appear in a separate sub-menu when you place your mouse cursor over the ‘Page 2’ menu item. See the screenshot below: