Jump to content
Sign in to follow this  
compartmentlife

Setting different font colors for each category?

Recommended Posts

compartmentlife

I'm color coding my blog categories. I know I can set the color in the title of each post with a snippet of HTML, but how do I hard code each category to show the title in a different color?

Share this post


Link to post
Share on other sites
nett-ed

So you're trying to have just the title change colors based on the category it belongs to? If so you'll have to create a css entry in the Custom CSS section of the PlatformPro settings. this would be an example for the uncategorized category

	.category-uncategorized .fpost .post-title h2 a {
	color:#FF0000;
	}
	

just change the uncategorized to the name of your category

Share this post


Link to post
Share on other sites
compartmentlife

Site: [url=http://compartmentlife.com] You've got it. So if I wanted to change it for a specific category I would just replace "uncategorized" with "Geek Out" or another one of my category names? EG:

.category-geek out .fpost .post-title h2 a {
	color:#FF0000;
	}

Share this post


Link to post
Share on other sites
compartmentlife

Yes, I got it working, but I had to find the names of each menu item rather than the "title" of each. Not hard with FireBug, but not intuitive with their naming not being consecutive...

Share this post


Link to post
Share on other sites
compartmentlife

Sorry, I confused two separate topics I have posted. This one is not resolved. The part I have worked out is color coding my MENU, but here I am looking for how to make all post titles within a category show in a specific color. Right now I have to use HTML to change the color for each title as I create the post. Is there a way to make this a constant? As you can see by my menu colors, I want all "Geek Out" posts to be color coded with ORANGE and others in their own color. Since I will not be the primary contributor to this blog I want to ensure that it is always managed properly. www.compartmentlife.com

Share this post


Link to post
Share on other sites
cmunns

You would use the code provided by Eduardo, but for example for geekout the code would be ` .category-geekout .fpost .post-title h2 a { color:#FF0000; } ` and for Life of The Party ` .category-entertaining .fpost .post-title h2 a { color:#FF0000; } ` If you view the source of your pages look for the classes attached to the body.

Share this post


Link to post
Share on other sites
compartmentlife

Where are finding the truncated name of each category? I cannot seem to find it in the code using FireBug.

Share this post


Link to post
Share on other sites
compartmentlife

Ok, that works WITHIN the category, but the color coding does not appear on the homepage "funnel" with all new blogs or into the FEATURE. Any idea how to make this happen?

Share this post


Link to post
Share on other sites
cmunns

Should work if you eliminate the space between the first two classes ` .category-entertaining.fpost .post-title h2 a { color:#FF0000; } `

Share this post


Link to post
Share on other sites
compartmentlife

How do I find the "code name" of each category? I'm using firebug, but I can't find anywhere that it is declared. For example, I have a category titled "Life of the Party", but you said to modify it the category is specified as "entertaining"... Where do I find this?

Share this post


Link to post
Share on other sites
compartmentlife

Nevermind, I found it in the wordpress menu, but I was still unable to identify it by looking at the code.

Share this post


Link to post
Share on other sites
compartmentlife

Alright, I have specified colors for every category. Problem: half of them are working, half of them are not... Any ideas?

Share this post


Link to post
Share on other sites
compartmentlife

OK... so, I figured out that the categories that are NOT working are the ones who's "slug" has an underscore in them. I replaced all of the underscores on my category slugs with hyphens and updated the code accordingly and it worked. However, it still isn't changing the font color in the feature. I guess I can live with that.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×