Title: Category image
Last modified: August 19, 2016

---

# Category image

 *  [Philljc](https://wordpress.org/support/users/philljc/)
 * (@philljc)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/category-image-2/)
 * Hello. I have these little areas for my categories:
 * [http://www.coflash.com/stuff/author.jpg](http://www.coflash.com/stuff/author.jpg)
 * For each category I would like to use a different colour. For example:
 * News = Green
    Opinion = Blue Update = Orange
 * And so on. Is there an easy way to assign a category to each colour/background
   image so when I select that category, it automatically does this?
 * Thanks

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/category-image-2/#post-1865035)
 * > Is there an easy way to assign a category to each colour/background image so
   > when I select that category, it automatically does this?
 * if the area has a category dependant css class, yes – however nobody can check
   this from your linked image.
 * look into ‘post_class()’ [http://codex.wordpress.org/Function_Reference/post_class](http://codex.wordpress.org/Function_Reference/post_class)
   
   or ‘body_class()’ [http://codex.wordpress.org/Function_Reference/body_class](http://codex.wordpress.org/Function_Reference/body_class)
 * or post a link to your site for more detailed suggestions.
 *  Thread Starter [Philljc](https://wordpress.org/support/users/philljc/)
 * (@philljc)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/category-image-2/#post-1865222)
 * All good, I did it with jQuery.
 * $(“.category:contains(‘Review’)”).css({backgroundImage: ‘url(“/wp-content/themes/
   shape/images/catreview.jpg”)’});
 * $(“.category:contains(‘News’)”).css({backgroundImage: ‘url(“/wp-content/themes/
   shape/images/catnews.jpg”)’});
 * $(“.category:contains(‘Article’)”).css({backgroundImage: ‘url(“/wp-content/themes/
   shape/images/catarticle.jpg”)’});
 * etc, with a backup JPG as a default if they have JS off.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Category image’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [Philljc](https://wordpress.org/support/users/philljc/)
 * Last activity: [15 years, 4 months ago](https://wordpress.org/support/topic/category-image-2/#post-1865222)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
