• Resolved ads1018

    (@ads1018)


    I created three different pages. Is it possible to style the current_page_item link for each specific page? For example, I’d like the current_page_item link for page 1 to be blue but the current_page_item link for page 2 to be orange.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Each page has its own unique ID, try something along the lines of:

    .current_page_item .page-item-1 {
      color: blue;
    }
    .current_page_item .page-item-2 {
      color: orange;
    }

    Thread Starter ads1018

    (@ads1018)

    For some reason that doesn’t work. Here are what my pages look like in my source code.

    <ul>
    <li class="page_item page-item-212 current_page_item"><a href="https://localhost:8888/wordpress" title="home">home</a></li>
    <li class="page_item page-item-6"><a href="https://localhost:8888/wordpress/test123/" title="about">about</a></li>
    <li class="page_item page-item-52"><a href="https://localhost:8888/wordpress/contact/" title="contact">contact</a></li>
    </ul>

    My bad … I forgot to reference the anchor and added a space, try this:

    .current_page_item.page-item-212 a{
      color: blue;
    }
    .current_page_item.page-item-6 a{
      color: orange;
    }

    Thread Starter ads1018

    (@ads1018)

    Excellent it worked! I had no idea having a space between two separate classes made a difference. Thanks so much.

    You’re welcome!

    Fantastic – about the fifth page I’ve been to trying to crack this one and it worked – you’re a star

    @cais, your great.

    But It not work on IE6…

    #menu li.current_page_item.page-item-2 a {}

    When I navigate in different page the current_page_item styles of page-item-2 are stayed…

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Current_page_item’ is closed to new replies.