Add Custom Classes to Wordpress Posts
While developing my latest WordPress plugin, Initial Letter, I needed to figure out how to add a custom class to the post container. While I actually didn't end using this method I figured it would be an easy thing to share in case others were looking to do the same thing.
Basically it comes down to adding a filter which ties into the ‘post_class’ hook. Keep in mind that this will only work if the theme you're using implements the post_class() function, which pretty much all themes should use.