WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] get_posts - Return the 5 most recent post. (5 posts)

  1. GSmith84
    Member
    Posted 7 years ago #

    I've tried a few searches through the forums and such and nothing solid came up for me.

    I'm trying to get the 5 most recent posts to show up in my theme like on this website towards the bottom.

    http://redline.web.id/

    Thanks,
    Gary

  2. JoyceD
    Member
    Posted 7 years ago #

    This works for me:

    <?php query_posts('showposts=5'); ?>
     <ul>
      <?php while (have_posts()) : the_post(); ?>
        <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
      <?php endwhile; ?>
     </ul>
  3. GSmith84
    Member
    Posted 7 years ago #

    Thanks,

    That works like a breeze :)

    Gary

  4. geraldmorales
    Member
    Posted 6 years ago #

    Same here Thank you very much JoyceD

  5. Sebarry
    Member
    Posted 6 years ago #

    Hi,

    I'm a complete WordPress newbie and someone has asked me if they can do what's been solved above. Where do I put the code that Joyce gave?

    Thanks,

    Sean

Topic Closed

This topic has been closed to new replies.

About this Topic