WordPress.org

Ready to get started?Download WordPress

Forums

Current Menu Item CSS (3 posts)

  1. D C
    Member
    Posted 2 years 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.

    <div id="nav">
                <ul>
                <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>
                </ul>
     </div>

    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.

    Please help!

  2. esmi
    Forum Moderator
    Posted 2 years ago #

    Try using wp_nav_menu() or wp_list_pages() to generate your nav menu. They output the classes you need.

  3. D C
    Member
    Posted 2 years ago #

    Ok, thanks

Topic Closed

This topic has been closed to new replies.

About this Topic