[wp-testers] adding class to first menu item when using wp_nav_menu()?

Jason Bobich jason_bobich at hotmail.com
Thu May 13 22:26:01 UTC 2010


Is it possible to add a class to the first menu item when showing a menu with wp_nav_menu()?

Or is there a way to completely remove the wrapping ul tag so my theme's markup could be something like this:

<ul>
    <li class="first"><a href="" title="">HOME</a></li>
    <?php wp_nav_menu(); ?> 
</ul>

Similar to how if you were using wp_list_pages you could do:

<ul>

    <li class="first"><a href="" title="">HOME</a></li>

    <?php wp_list_pages('title_li='); ?> 

</ul>

My main goal is trying to figure out a way to add special styling to the first menu item, and I'm not sure if there's a way to go about doing this? Any tips on this? 

Would be a cool feature if it's not already implemented to add a class to the first menu item.
 		 	   		  


More information about the wp-testers mailing list