Posted By

amyb on 02/04/11


Tagged

wordpress


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

Almaz
hkamci


Wordpress - show featured image with post or a default image if no image set


 / Published in: PHP
 

  1. <?php if(has_post_thumbnail()) {
  2.  
  3. the_post_thumbnail();
  4.  
  5. } else {
  6.  
  7. ?>
  8.  
  9. <img width="100" height="100" src="placeholder100.jpg" alt="" border="0" />
  10.  
  11. <?php
  12. }
  13. ?>

Report this snippet  

You need to login to post a comment.