• Resolved JuanAcosta1992

    (@juanacosta1992)


    Is there anyway or plugin that works with your theme that will replace the color of the title of each post depending on the category that it is in?

Viewing 2 replies - 1 through 2 (of 2 total)
  • You don’t need a plugin. You can do this just by adding selectors to one of your virtual CSS files.

    If you examine each of your posts using Firebug, you’ll notice that each post entry has a class assigned to it like category-category_slug. So you can use that to change the color of your post title. Let’s say, for example, that you have a category called Canines and the slug is dogs. All of the posts that have you’ve marked as Canine will then have the class category-dogs.

    So in your CSS file (I would probably put it at the end of various.css), just add this CSS rule:

    .category-dogs h2 a {
    	color: #f00;
    }

    h2 is used as the post title in the blog page, while h1 is used as the post title in the single post page, so you may want another selector for that as well. Note that this just changes the second half of the title. The first part, which changes color, would need a separate selector if you wanted to change that color, but you can probably figure out how to do that with the tips I’ve given you above. Just use Firebug to take a look at the elements within the post.

    Thread Starter JuanAcosta1992

    (@juanacosta1992)

    Thank you very much

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Different post title color for each category’ is closed to new replies.