For showing excerpts w/ thumbnails on Posts page


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



Copy this code and paste it in your HTML
  1. // index.php:
  2.  
  3. <?php if (has_post_thumbnail()) { ?>
  4. <div class="front-page-thumbnail">
  5. <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail('front-page-thumbnail'); ?></a>
  6. </div>
  7. <?php } ?>
  8. <div class="post-content">
  9. <?php the_excerpt(); ?>
  10. </div>
  11.  
  12. // functions.php:
  13. add_image_size('front-page-thumbnail', 150, 150, true);

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.