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


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).

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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