wp adds post thumnails


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. //post thumbnails - add to fucntions
  2. add_theme_support( 'post-thumbnails' );
  3.  
  4.  
  5. //add to loop
  6. <?php
  7. if ( has_post_thumbnail() ) {
  8. <?php the_post_thumbnail(); ?>
  9. } else {
  10. // the current post lacks a thumbnail
  11. }
  12. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.