Last night I changed it to what I had previously. Which worked for all but the two advertising items. I put in you’re code:
if (get_post_meta($post->ID, 'media', true) == '0' )
But take a look, now most of the items link to the permalink, not the image file as is intended, so something isn’t right. Thoughts?