how to make a current link have a css style in wordpress

Discussion in 'WordPress' started by leilal, Nov 11, 2010.

  1. #1
    Hi,

    On my site in the navigation, when it is on a certain page I want that link to be a different colour depending what page it is on. How do I firstly style this in the style sheet and secondly what is the wordpress code i need to put in the menu navigation php file.

    I have tried different ways in of doing it and it just isnt working. I cant seem to find much info on it and im very stuck.

    Thankyou
     
    leilal, Nov 11, 2010 IP
  2. KimiGermany

    KimiGermany Peon

    Messages:
    1,117
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You will need to check the page source and the li item class.

    Example, in my blog (wordpress tut link in my signature) I have "free service" tab which stays yellow always, because i put "li.page-item-4357 a" different style css. the page item id will be different than yours.
     
    KimiGermany, Nov 11, 2010 IP
  3. daljit

    daljit Well-Known Member

    Messages:
    312
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #3
    daljit, Nov 11, 2010 IP