buzzifyme
Member
Posted 3 months ago #
I am looking to customize by post title color based upon what category the post is labeled. Each post will only have one category. For example, all posts under category A will have blue titles while all post under category B will have green titles.
From what I've researched, I need to use functions which is something I've only just started to learn. Any help is much appreciated.
I'm using the Twenty Eleven template if need to know.
genral: if you plan to customize Twenty Eleven, create achild theme to work with: http://codex.wordpress.org/Child_Themes
Twenty Eleven uses post_class() in the posts;
http://codex.wordpress.org/Function_Reference/post_class
this adds a category dependant css class to the post div, which you can use in style.css (of your child theme) to format the titles;
example:
(for linked titles in the index and archive pages)
.category-name-of-cat-A .entry-title a { color: green; }
(for titles in single posts)
.category-name-of-cat-A .entry-title { color: green; }
try to get used to working with a tool such as Firefox' add-on Firebug to assist with identifying the relevant css selectors.
http://getfirebug.com/