title: How can I check for a thumbnail in WordPress?
body: <p>How can I can I check if a post has a thumbnail and if does do something? If doesn't do something else. This is what I have:</p>
  
  <pre><code>        &lt;?php if(have_posts()) : ?&gt;
              &lt;?php while (have_posts()) : the_post(); ?&gt;
  
                  &lt;?php if ( has_post_thumbnail() ) { ?&gt;
                          &lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;
                  &lt;?php 
                  }else{ 
                  ?&gt;
                      &lt;?php the_post_thumbnail(); ?&gt; 
                  &lt;?php
                  } 
                  ?&gt;  
  
              &lt;?php endwhile; ?&gt;
  
          &lt;?php endif; ?&gt;
  </code></pre>
  
  <p>Any help will be appreciate it.</p>