Create an “All Posts” or “Archives” Page with WordPress 3.0?

Create a new template file and do this as the loop:

query_posts( array( 'posts_per_page' => -1, 'post_status' => 'publish' ) );
if( have_posts() ):
  echo '<ul>';
  while( have_posts() ):
    the_post();
    echo '<li><a href="';
    the_permalink();
    echo '">';
    the_title();
    echo '</a></li>';
  endwhile;
  echo '</ul>';
endif;
wp_reset_query();

Then just use that template for a page and it’ll automatically generate the page. Check out the codex page for query_posts() for more information on how to change the query.

Leave a Comment