[resolved] tag and category colors (7 posts)

  1. miharbio
    Posted 2 years ago #


    Is there a simple way to manage colors and effects for specific categories and tags of posts?


  2. Caroline Moore
    Theme Author

    Posted 2 years ago #

    Sure, read up on the body_class() function, which applies specific CSS classes to tags and categories (among other things).

  3. miharbio
    Posted 2 years ago #

    Thanks, though, it's been a little hard trying to wrap my head around this...

    I know coding help here is merely a courtesy.., but do you know where I might be able to find more thorough examples?

    thanks, again

  4. Andrew
    Forum moderator
    Posted 2 years ago #

    Hi Miharbio,
    Do you have Google Chrome?

  5. miharbio
    Posted 2 years ago #

    I do. Is there a way inspecting the elements of the page will guide me here?

  6. Andrew
    Forum moderator
    Posted 2 years ago #

    Yes, for example, right click on the page and select 'inspect element'.
    You can see a new toolbar appear that exposes the HTML (on the left) and CSS applied to that HTML (on the right).

    Try searching through the HTML for particular classes that uniquely identify the post/ page, in relation to Caroline's advice.

    Look at the <body> element. That has a bunch of classes, of which the unique class may be something like 'page-id-10'.

    You can then construct some CSS from this:

    .page-id-10 .post {
     background: deeppink;
  7. miharbio
    Posted 2 years ago #

    Ohh, I think I see, now.

    I didn't understand how what wordpress calls "tags" and "categories" are processed as "classes" with the code, if that is the right way one would say it.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic


No tags yet.