Support » Fixing WordPress » A way to list all posts for an archive page?

  • Resolved CMoseley

    (@cmoseley)


    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!

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

Viewing 1 replies (of 1 total)
  • The topic ‘A way to list all posts for an archive page?’ is closed to new replies.