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

I’d like to create an “All Posts” page on the Ocean Bytes blog that contains an unordered list of all Titles of the posts to date, with each title hyperlinking to its blog post.

There appear to be several plugins that do something like this, but most do not list WordPress 3.0+ as supported yet, or they want to subset the blog postings by Year and then Month which is not desired.

Any suggestions for the “best way”?

Thx.

3 Answers
3

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