WordPress.org

Support

Support » Themes and Templates » Spun » [Resolved] tag and category colors

[Resolved] tag and category colors

  • Hello,

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

    thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • Theme Author Caroline Moore

    @sixhours

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

    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

    Hi Miharbio,
    Do you have Google Chrome?

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

    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:
    (example)

    .page-id-10 .post {
     background: deeppink;
    }

    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.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Resolved] tag and category colors’ is closed to new replies.
Skip to toolbar