0

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!

1
  • Where are those lists? Front-end, back-end? Please be specific.
    – fuxia
    Nov 16, 2012 at 5:47

1 Answer 1

0

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 {
    height:32px;
    width:32px;
    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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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