Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Highlight current category/tag in wordpress

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #36131
    Klo
    Participant

    Hi,

    I know this is old discussion, but this is different case.

    Im trying to highlight categories/tags buttons (placed on left) on this site http://www.deluxetemplates.net/ when category/tag is active, same as hover.

    I created a HTML code for those categories/tags, so Im not getting how to highlight those, to do with CSS (which I tried and was unlucky or PHP ?)

    I also, would like to highlight tags when post is active/open (this is less important).

    Any suggestion is welcome.

    Thanks
    klo

    #94644
    Billy
    Participant

    Normally, WordPress should give your body tag certain classes. I think (not entirely sure) that the category name and tag names are in those classes. If so, then you can say this in the CSS:


    li.tag1 {

    }
    body.tag1 li.tag1 {

    }
    #94648
    Klo
    Participant

    thanks for reply, I did it, but didn’t worked for me

    here css for one tag only

    body.blogger-travel li.blogger-travel {
    background: url(“images/img-all.png”) no-repeat scroll 0 -311px transparent;
    color: #000000;
    }

    here HTML

  • Travel
  • for this tag only
    http://www.deluxetemplates.net/tag/travel-blogger-templates

    what I’m doing wrong ?

#94656
Billy
Participant

Bizarrely, the body has no classes. Usually WordPress gives it a load of classes.
try changing the body tag to this:

>

Then open the web-page, and inspect the element. Look at what the body’s id and classes are, and change the code above from
body.blogger-travel
to
body.
or
body#

#94674
Klo
Participant

yes, now its working, thank you.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.