[resolved] How to get posts to sort ascending rather than descending by date? (2 posts)

  1. deko
    Posted 10 years ago #

    I've looked around the admin pages but did not find how to set the sort order of how posts appear in my blog.

    Is it possible to set it ascending by date rather than descending by by date? If not, there must be a simple code hack to make this happen. Any ideas?

    Thanks in advance.

  2. Austin Matzko
    Posted 10 years ago #

    Somewhere in your index.php file you should see something like
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    Add before that the following:

    <?php $wp_query = new WP_Query('order=ASC'); ?>

    That should do what you want.

Topic Closed

This topic has been closed to new replies.

About this Topic