[resolved] A way to list all posts for an archive page? (2 posts)

  1. CMoseley
    Posted 9 years ago #

    Is there any php or something I could run either on a page or as a page template that would just list all the titles of the posts I've done so far in sequence and have them link back to the original post?

    I'm trying to make an archive page similar to what I have now, but instead of just showing 5 posts (which is how many I have set in my control panel to show per loop), I want to show all my posts.


  2. jkeyes
    Posted 9 years ago #

    Here's some PHP that'll list all of your posts as links:

    $myposts = get_posts("numberposts=-1");
    foreach($myposts as $p) :
      <a href="<?php echo(get_permalink($p->ID)); ?>">
        <?php echo($p->post_title); ?>
    <?php endforeach; ?>

    Ref: get_posts documentation.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.