Adding thumbnails to the archives page

I am new to WordPress and using the template BlankSlate ad on the archives page I want to show the thumbnail of the image inserted in to the post, how would I do this? This is my archives.php code.

Thanks in advance!

<?php the_post(); ?>
<?php if ( is_day() ) : ?>
<h1 class="page-title"><?php printf( __( 'Daily Archives: %s', 'blankslate' ), '<span>' . get_the_time(get_option('date_format')) . '</span>' ) ?></h1>
<?php elseif ( is_month() ) : ?>
<h1 class="page-title"><?php printf( __( 'Monthly Archives: %s', 'blankslate' ), '<span>' . get_the_time('F Y') . '</span>' ) ?></h1>
<?php elseif ( is_year() ) : ?>
<h1 class="page-title"><?php printf( __( 'Yearly Archives: %s', 'blankslate' ), '<span>' . get_the_time('Y') . '</span>' ) ?></h1>
<?php elseif ( isset($_GET['paged']) && !empty($_GET['paged']) ) : ?>
<h1 class="page-title"><?php _e('Blog Archives', 'blankslate' ); ?></h1>
<?php endif; ?>
<?php rewind_posts(); ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'entry' ); ?>
<?php endwhile; ?>

Related posts

Leave a Reply

1 comment

  1. Place this code inside your loop where you want it to appear.

    <?php if(has_post_thumbnail()) { the_post_thumbnail(); }?>

    From the documentation:

    Display the Featured Image (previously called Post Thumbnails) for the
    current post, as set in that post’s edit screen.

    This tag must be used within The Loop. Use get_the_post_thumbnail($id,
    $size, $attr ) instead to get the featured image for any post.

    To enable post thumbnails, the current theme must include
    add_theme_support( ‘post-thumbnails’ ); in its functions.php file. See
    also Post Thumbnails.