WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Displaying links to more than one post (6 posts)

  1. Kristopher
    Member
    Posted 8 years ago #

    Hello. I'm wondering what I need to edit so I can pull off the effect of displaying a link to more than one post. An example would be a category called "Recent Posts" then having like the last 5 posts show up. Here's an example:

    http://www.penandthink.com/niggle/

    That site also has a different feature that I'm trying to figure out. How do I create an excerpt to the last post, so that a user can click on a link to read the rest of it.?

  2. Ment0r
    Member
    Posted 8 years ago #

  3. Kristopher
    Member
    Posted 8 years ago #

    This is just related posts. I want to incorporate my five latest posts since the most recent.

  4. Kristopher
    Member
    Posted 8 years ago #

    Here's my example. This is my page:

    http://www.krisgosser.com/blog/

    And this is the PHP Code I used to try to populate a ul with the past posts:


    <h2>Past Entries</h2>

    <ul>
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    <li id="post-<?php the_ID(); ?>"><a>" rel="bookmark" title="Read this entry"><?php the_title(); ?></a> <span class="date"><?php the_time('M j') ?></span>
    <?php endwhile; ?>
    <?php else : ?>
    <h2 class="center">PHP Error: Not Found</h2>
    <?php endif; ?>
    </ul></code>

    I took it off of the index page with the way that it populates its posts. What am I doing wrong though? I get a not found error.

  5. TechGnome
    Moderator
    Posted 8 years ago #

    You might want to read through this page:
    http://codex.wordpress.org/The_Loop#Multiple_Loops

    It should be a lot of help.

    -tg

  6. Kristopher
    Member
    Posted 8 years ago #

    Fantastic. That link was exactly what I was looking for. Thanks for the help!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.