Om Ar
Om Ar

Reputation: 3

How can I add thumbnail to recent post, Wordpress

I'm using bootstrap theme on wordpress. My recent post show only the title and a small text but no thumbnail of the origine post.

I need the recent post show a small thumbnail in the right then the title and the smal text

here is my code

       <div class = "col-md-10">
            <?php while(have_posts()) : the_post(); ?>
                <div class="well well-sm">
                <h3>
                    <a href = "<?php the_permalink(); ?>"><?php the_title(); ?></a>
                </h3>
                <p>
                    <?php the_excerpt(); ?>
                </p>
                <small class="text-muted"><?php the_time('j F Y'); ?></small>
                </div>
            <?php endwhile; wp_reset_query(); ?>
        </div>

Upvotes: 0

Views: 361

Answers (1)

Aibrean
Aibrean

Reputation: 6422

Assuming you have theme support for post thumbnails, you just need to add this code to display the featured image thumbnail: <?php the_post_thumbnail(); ?>.

To add theme support, add this to your functions.php file: add_theme_support( 'post-thumbnails' );

Upvotes: 2

Related Questions