Showing All Posts on a single Page
-
I’m looking to create a single Page that displays a list of every post stored in the blog. Basically I’m looking to create a Table of Contents.
My first thought was to use
<?php wp_get_archives('type=postbypost'); ?>
but there’s no way to sort the posts alphabetically.My next thought was to create a Page template and use a custom loop. I used the code shown at the end of this post but it only lists the current Page in the list.
Any thoughts on either tweaking the loop code or other implementations? I just want a list of all the posts in alphabetical order.
<?php rewind_posts(); ?> <?php $posts3 = query_posts($query_string . '&orderby=title&order=asc&posts_per_page=-1'); if (have_posts()) : while (have_posts()) : the_post(); ?> <li style="list-style:none"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>" target="_top"><?php the_title(); ?></a></li> <?php endwhile; ?> <?php else : ?> <?php endif; ?>
- The topic ‘Showing All Posts on a single Page’ is closed to new replies.