WordPress.org

Ready to get started?Download WordPress

Forums

List last five posts (5 posts)

  1. keress
    Member
    Posted 6 years ago #

    I'm trying to find the code I need to add to a sidebar that will pop up the title (with links) of the last four or so posts. I've been wandering around the codex for awhile to no avail. Can anyone point me in the right direction?

  2. iridiax
    Member
    Posted 6 years ago #

    One option:

    <ul>
    <?php wp_get_archives('type=postbypost&limit=4'); ?>
    </ul>
  3. apostaganha2
    Member
    Posted 5 years ago #

    <?php get_archives('postbypost', 5); ?>

  4. freakmaster
    Member
    Posted 5 years ago #

    Thanks you guys. I'd run into the same question as keress and I ended up using the snippet from apstaganha2 and it worked like a charm.

  5. iridiax
    Member
    Posted 5 years ago #

    get_archives was depreciated in WordPress 2.1. Use wp_get_archives instead.

    http://codex.wordpress.org/Template_Tags/get_archives

Topic Closed

This topic has been closed to new replies.

About this Topic