I’m using wp_nav_menu in WordPress to create my navigation
The output is similar to this(I have removed href links)
<nav id="pageNav">
<ul id="menu-headernav" class="menu">
<li><a href="">Home</a></li>
<li><a href="">About</a></li>
<li><a href="">Services</a></li>
<li><a href="">Work</a></li>
<li><a href="">Contact</a></li>
</ul>
</nav>
I need to style each link separately.
How can I add an id to each (li) or (a) in the menu so I can style it.
Sounds like you would need to use a Custom Walker Function
I’ve found some code on the WordPress Suport Forums which might be of some use:
Walker Class – Pastebin
Thread Source – WP Support
Output: