I am using.
<?php wp_nav_menu($args); ?>
to get menu from WordPress.
It returns the menus with <ul> and <li> structure.
How can i set class name for every <li> tag uniquely.
|
I am using.
to get menu from WordPress. It returns the menus with |
||||
|
You can use the CSS class for the menu. Then, for every menu item, you have an additional input that is named "CSS Classes" |
|||
|
|
|
I think the best solution would be to write your own walker class for it and pass it as an argument, but I must admit that's not too straight forward if you are not too familiar with wordpress development. I would solve it like this:
|
|||
|
|
|
This should help you buddy - http://wpveda.com/add-custom-classes-wpnavmenu-condition/ |
|||
|
|
|
What is the reason for needing custom classes? WordPress menus include a number of classes on the |
||||
|
|
nav_menu_css_class– One Trick Pony Jun 23 '11 at 10:57