WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need a simple way of assigning a custom icon whenever a category gets listed.

I am using Custom Post Types and Taxonomies with Views and Types (plugins).

For example, I have a Custom Post Type of Properties > and categories of Commercial/Residential/Hotels (each need an icon).

Maybe assigning a class some how to each would be a good way...

I think this would be a very useful thing for a lot of people so would really appreciate any thoughts/suggestions!

share|improve this question
Where are those lists? Front-end, back-end? Please be specific. – toscho Nov 16 '12 at 5:47

If your theme uses body_class and post_class then you should have CSS enough to do this.

Make a <div> for your icon.

<div class="mycategoryicon"></div>

Add some style.

.category-slug .mycategoryicon {
    background:#ffffff url('slug-icon.jpg') no-repeat;

The "slug" part of the class name should be your actual category slug. Height and width can of course be whatever you need.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.