Support » Plugins and Hacks » List all posts on front page

  • Hello,

    I need to list all posts on my front page. I want all the posts on the fron page to include all of the content and the title. I would also like them to be listed in alphabetical order.

    <?php
    // we add this, to show *all* posts sorted
    // alphabetically by title
         $posts = query_posts($query_string . '&orderby=title&order=asc&posts_per_page=-1');
    // here comes The Loop!
    if (have_posts()) : while (have_posts()) : the_post(); ?>

    The above code was found at http://codex.wordpress.org/Alphabetizing_Posts
    This code is very close to doing the trick but it does not include the title of the post or any way to separate the posts with say an <hr /> html tag.

    Thanks,
    Nathaniel

Viewing 1 replies (of 1 total)
  • Nevermind… Resolved.. Here is the code..

    <?php
    // we add this, to show *all* posts sorted
    // alphabetically by title
         $posts = query_posts($query_string . '&orderby=title&order=asc&posts_per_page=-1');
    // here comes The Loop!
    if (have_posts()) : while (have_posts()) : the_post(); ?>
    <hr />
    <h1><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>

Viewing 1 replies (of 1 total)
  • The topic ‘List all posts on front page’ is closed to new replies.