How To Loop Through list with Custom Post Types

Maybe this could be useful.

I used it on my own site to display a list of thumbnails.

 <?php  
    // check if there's a thumbnail
   if ( has_post_thumbnail($post->ID)) {

     //show thumbnail
     echo 'get_the_post_thumbnail($post->ID, 'thumbnail' , array('class' => "img-responsive yourClass"));

   } else { 
     //show another image if there's not a thumb 
     echo '<img class="img-responsive" src="'.get_template_directory_uri().'/MISSING-PHOTOS.jpg">';

    }

   ?>

Hope can help you.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)