• I want to ‘Alphabetize’ posts but all the post tiles are in numbers such as 945, 1081, ect. I have tried to alphabetize but have been unsuccessful. Here is what my loop looks like for my archive page(with some of the extra code taken out. Thanks a ton in advanced.

    -Justin

    <?php if (have_posts()) : ?>

    <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>

    <?php query_posts(‘posts_per_page=100’); ?>
    <?php while (have_posts()) : the_post(); ?>
    <div class=”post5″ id=”<?php the_ID(); ?>”>

    <h3>Unit Number: “><?php trim_title(); ?></h3>
    <hr />
    “>Click For More Images

    <div id=”moretext”><p>
    “><span class=”moretext”>Click For More Information</span> </p></div>
    </div>
    </div>

    <?php endwhile; ?>

    <?php else :

    if ( is_category() ) { // If this is a category archive
    printf(“<h2 class=’center’>Sorry, but there aren’t any posts in the %s category yet.</h2>”, single_cat_title(”,false));
    } else if ( is_date() ) { // If this is a date archive
    echo(“<h2>Sorry, but there aren’t any posts with this date.</h2>”);
    } else if ( is_author() ) { // If this is a category archive
    $userdata = get_userdatabylogin(get_query_var(‘author_name’));
    printf(“<h2 class=’center’>Sorry, but there aren’t any posts by %s yet.</h2>”, $userdata->display_name);
    } else {
    echo(“<h2 class=’center’>No posts found.</h2>”);
    }
    get_search_form();

    endif;
    ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • <?php query_posts('posts_per_page=100'); ?>

    change to

    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts($query_string.'&posts_per_page=100&paged=' . $paged.'&orderby=title&order=ASC');

    Thread Starter justinwohler

    (@justinwohler)

    Thanks so much. This for the most part works. For some reason trucks with the numbers above 1000 are on top in order until it almost “resets” then starts with 800 and goes back up. As of right now this is the closest I have come though. Thanks much.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘List Posts Numerically **Help’ is closed to new replies.