Vytváření a úpravy menu s využitím „Walkeru“
Once you have created a menu at your wordpress backend at Appearance > Menus you can use a wordpress function called „wp_nav_menu()“:http://codex.wordpress.org/Function_Reference/wp_nav_menu within your template files to display those menus.
When you are at the Appearance > Menus Site you need to look at the top right and you will notice a “Screen Option” tab. Click it and you will get the option to display several other input fields for each menu item, among them a checkbox to show the description.
A special “Walker” class iterates over each data record and then displays this record accordingly. We can simply create our own custom walker extending that PHP class. That way we dont need to care about fetching the stuff from the database or preparing the data arrays. We only need to extend the part of the wordpress code that outputs the list to functions.php file and add the code
class description_walker extends Walker_Nav_Menu
…
After we have created a custom walker we only need to tell wordpress that it should use our walker instead of its own. This can be easily done by calling the „wp_nav_menu()“:http://codex.wordpress.org/Function_Reference/wp_nav_menu with the walker parameter set.
Zdroj: „Improve your WordPress Navigation Menu Output“:http://www.kriesi.at/archives/improve-your-wordpress-navigation-menu-output