Support » Fixing WordPress » How to: Post Excerpt with Image?

  • Hi all,

    Ive been searching the forums for an answer on how to get the 5 most recent posts with an image attached. Each of my posts always has an image under the title. I would like the 5 most recent posts to display with the image attached, and the excerpt below the image.

    The code below works fine to pull the title, author, date and excerpt, but how can I get the image to appear as well. Is this possible? Ive tried a few plugins and playing with the PHP but cant seem to get it working…any thoughts?


    <?php $arc_query = new WP_Query(‘orderby=post_date&order=DESC&showposts=5’); ?>
    <?php while ($arc_query->have_posts()) : $arc_query->the_post(); ?>
    <h1>” rel=”bookmark”>
    <?php the_title(); ?>

    <h3><?php the_time(‘F jS, Y’) ?> <span class=”by”>by</span><span class=”author”> <?php the_author() ?> </span></h3>
    <?php the_excerpt(); ?>
    <?php endwhile; ?>

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to: Post Excerpt with Image?’ is closed to new replies.