WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. CMoseley
    Member
    Posted 7 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.

    http://vooc.designer-web.com/cat/uncategorized/
    Thanks!

  2. jkeyes
    Member
    Posted 7 years ago #

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

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

    Ref: get_posts documentation.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.