0

hi
i need to show the last post thumbnail only
i had the code but im now looking for code to get image
i need to place the image on the top

<ul>
<?php $recent = new WP_Query("cat=1&showposts=10"); while($recent->have_posts()) : $recent->the_post();?>
<li><a href="<?php the_permalink() ?>" rel="bookmark">
<?php the_title(); ?>
</a></li>
<?php endwhile; ?>
<?php wp_reset_query(); ?>
</ul>

2
Contributors
2
Replies
4
Views
5 Years
Discussion Span
Last Post by kingofnothing
0

To get the featured image, you can use the following code:

<?php if(has_post_thumbnail()): ?>
    <div class="image">
        <?php the_post_thumbnail(); ?>
    </div>
<?php endif; ?>
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.