Support » Themes and Templates » Current Menu Item CSS
4 years, 10 months ago
This has been gone over hundreds of times but I just cannot find a good answer for use in WordPress with IMAGES for your navigation items.
Here’s my markup. First, my navigation menu found in my header.php file.
<li class="hnav""><a href="/">Home</a></li>
<li class="nnav"><a href="/news">News</a></li>
<li class="wnav"><a href="/weather">Weather</a></li>
Now, the CSS for it:
[CSS moderated as per the Forum Rules. Please just post a link to your site.]
Obviously the li tags already have unique ids. I cannot figure out how to do this anywhere since obviously every page calls the same nav in the header.
Try using wp_nav_menu() or wp_list_pages() to generate your nav menu. They output the classes you need.
4 years, 9 months ago