Sorry, I'm quite new to php. All I am trying to do is wrap an image in a div that contains the post class info so that I can style it accordingly using css. The original function is as follows:
if( ! empty( $img ) )
printf( '<a href="%s" title="%s">%s</a>', get_permalink(), the_title_attribute( 'echo=0' ), $img );
This on it's own works just fine, however the image is output on it's own without a surrounding div. My hope was to wrap that image in a div with a post class so that I may style the image and the div wrapped around it based on its category.
Alchymyth, I imagine there is a more simple way of doing this, but I'm a little stumped. Any help would be greatly appreciated.
Chris, thanks so much for the code. However, the printf for the image is now throwing an error instead. I believe there should have been a leading quote before the anchor tag, but that doesn't seem to completely fix it either.
Thank you in advance for your time and consideration on this. It really means a lot.