WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

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

The code I am currently using in the loop is in this code snippet: https://gist.github.com/1316622

This just seems messy, and long.

I am thinking the best method would really be to use CSS sprites and the post class, but for some reason I cannot put my brain around how to do this.

I created another gist of the output of my WP loop, so you can see the post format is added to the class of the article. Not sure if that is the easiest method to address this, and am appreciative of any help: https://gist.github.com/1316633

share|improve this question
up vote 0 down vote accepted

Using CSS and image sprites is exactly what I do in Oenology. (See it in action here.)

Mine is a bit tricky, because I change the post container based on post-format type (some have post headers/titles, others don't; some have left/right margins added; etc. - also, I have dark and light icon sets, based on the color scheme selected). But, here's my code for dynamically generating the CSS (lines 418-598).

share|improve this answer
Perfect! Thanks Chip. I have always been a fan of your coding technique. – Rachel Baker Oct 26 '11 at 15:32

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.