WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] How to get posts to sort ascending rather than descending by date?

[Resolved] How to get posts to sort ascending rather than descending by date?

  • 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.

Viewing 1 replies (of 1 total)
  • 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.

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] How to get posts to sort ascending rather than descending by date?’ is closed to new replies.