How can I give id values to my navbar links? (4 posts)

  1. ArtInMotion
    Posted 8 years ago #


    I'm trying to create a graphical navbar on my site, similar to those at blazersix.com and ndesign-studio.com. At those sites, the li elements have classes like "#nav-about" and "#nav-home." On standard WordPress sites, these classes do not show up.

    For instance, here's what the code for a navigation link looks like on ndesign-studio:

    <li id="nav-home"><a href="http://www.ndesign-studio.com/">Blog</a></li>

    ...and here's what the code for a nav link looks like on my page:

    <li class="page_item page-item-3 current_page_item "><a href="http://www.lightningux.com" title="Home">Home</a></li>

    So on my page, there is no ID that clearly identifies each navigation item. Does anyone know how I can make my WP installation output links like the former one, where each navigation link has an ID that can easily be referenced from CSS? Thanks.

  2. Michael Fields
    Posted 8 years ago #

    Your html is actually already set up to do this. Check out the class attribute:

    class="page_item page-item-3 current_page_item "

    The important part is: page-item-3. You can apply a style to each item in you navigation by using this.

    you could also hard-code your navigation with exactly the html you want.

  3. odilonLPV
    Posted 8 years ago #

    I have exactly the same problem and it appears on each li. I'm also using Subpage Listing plugin and it appears here too, that makes impossible to apply a style on them.
    I guess it's a WP little configuration trick but what one?

  4. tjobbe
    Posted 8 years ago #

    Would this help? Maybe not what you are looking for, but worth pointing you to it anyway.


Topic Closed

This topic has been closed to new replies.

About this Topic