WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] get_posts – Return the 5 most recent post.

[Resolved] get_posts – Return the 5 most recent post.

  • 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

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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>

    Thanks,

    That works like a breeze 🙂

    Gary

    Same here Thank you very much JoyceD

    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

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] get_posts – Return the 5 most recent post.’ is closed to new replies.
Skip to toolbar