I am using.
<?php wp_nav_menu($args); ?>
for get menu from wordpress.it returns the menus with <ul> and <li> structure. In that i need to set class name for every <li> tag uniquely.
thanks ravi
|
I am using.
for get menu from wordpress.it returns the menus with thanks ravi |
||||
|
|
|
More easily, you can just enter a unique class name on the admin menu page |
|||
|
|
|
This should help you out buddy - http://wpveda.com/add-custom-classes-wpnavmenu-condition/ |
|||
|
|
|
Why? You can add both ID and class to the containing UL tag, using arguments passed to What are you trying to do, specifically? I'm sure we can find a way to accomplish it. |
|||
|
|
|
The only way that I could think to do this would be to add a filter to wp_nav_menu_items. Here is the code that I got to work by adding an ID (just add it to your themes functions.php file and change it as needed. You should be able to do something similar for classes):
It uses the last part of the url to create the page name for the class. So menu-item-2 for http://yoursite.com/page1/page2/ would become menu-item-page2. The |
|||
|
|