I found and modified a chunk of code found here: http://www.wprecipes.com/wordpress-tip-detect-if-a-post-has-at-least-one-image. <?php while ( have_posts() ) : the_post(); ?> $content = $post->post_content; $searchimages = '~<img [^>]* />~'; preg_match_all( $searchimages, $content, $pics ); $iNumberOfPics = count($pics[0]); if ( $iNumberOfPics > 0 ) { //your loop content goes here } <?php endwhile; ?> I think this just looks for images entered in the rich text editor - if you want to check for featured images as well you'll likely have to add something. Check out [`has_post_thumbnail`][1]. [1]: http://codex.wordpress.org/Function_Reference/has_post_thumbnail