Title: Reverse order posting
Last modified: August 18, 2016

---

# Reverse order posting

 *  [wiredkiwis](https://wordpress.org/support/users/wiredkiwis/)
 * (@wiredkiwis)
 * [21 years, 7 months ago](https://wordpress.org/support/topic/reverse-order-posting/)
 * Can this be done in WP?
    I have a blog set to posts paged but I want the posts
   to show the oldest first. Have hunted but cannot find a mention of it. Anyone
   like to point me in the right direction?

Viewing 3 replies - 16 through 18 (of 18 total)

[←](https://wordpress.org/support/topic/reverse-order-posting/?output_format=md)
[1](https://wordpress.org/support/topic/reverse-order-posting/?output_format=md)
2

 *  [stairway](https://wordpress.org/support/users/stairway/)
 * (@stairway)
 * [20 years ago](https://wordpress.org/support/topic/reverse-order-posting/page/2/#post-108400)
 * I had the same problem but found the solution here: [http://codex.wordpress.org/Template_Tags/query_posts](http://codex.wordpress.org/Template_Tags/query_posts)
 * There is no need to change any core files. Just insert this code right above 
   your loop, and change the variables to suit your needs.
 * `
    $categoryvariable=$cat; // assign the variable as current category $query='
   cat=' . $categoryvariable. '&orderby=date&order=ASC'; // concatenate the query
   query_posts($query); // run the query
 * works perfectly every time.
 *  [VeronicaRose](https://wordpress.org/support/users/veronicarose/)
 * (@veronicarose)
 * [20 years ago](https://wordpress.org/support/topic/reverse-order-posting/page/2/#post-108401)
 * <?php
    $categoryvariable=$cat; // assign the variable as current category $query
   = ‘cat=’ . $categoryvariable. ‘&orderby=date&order=ASC’; // concatenate the query
   query_posts($query); // run the query ?>
 * When I look at this I don’t understand which part I’m supposed to replace with
   the title of the category that I want changed. Can someone please help me?
 *  [zannmarketing](https://wordpress.org/support/users/zannmarketing/)
 * (@zannmarketing)
 * [20 years ago](https://wordpress.org/support/topic/reverse-order-posting/page/2/#post-108402)
 * stairway, thanks for pointing me to the right direction! The code you have posted
   doesn’t behave with paging. That is, I couldn’t get posts 11-20 to show up on
   page 2.
 * My solution is to add this code above The Loop:
 * `query_posts($query_string."&order=ASC");`
 * This will make all of the posts in all of your categories ordered to show the
   oldest post first and the newest post last.
 * To reverse order of posts in only one category use this:
 * `<?php if ($cat==x) {query_posts($query_string."&order=ASC"); } ?>`
 * Where x in $cat=x is the category ID number.
 * Note: if you still don’t know what The Loop is, it starts with this line:
 * `<?php if (have_posts()) : while (have_posts()) : the_post(); ?>`
 * The query_post should be ABOVE this line.

Viewing 3 replies - 16 through 18 (of 18 total)

[←](https://wordpress.org/support/topic/reverse-order-posting/?output_format=md)
[1](https://wordpress.org/support/topic/reverse-order-posting/?output_format=md)
2

The topic ‘Reverse order posting’ is closed to new replies.

## Tags

 * [chronological](https://wordpress.org/support/topic-tag/chronological/)
 * [post order](https://wordpress.org/support/topic-tag/post-order/)

 * 18 replies
 * 16 participants
 * Last reply from: [zannmarketing](https://wordpress.org/support/users/zannmarketing/)
 * Last activity: [20 years ago](https://wordpress.org/support/topic/reverse-order-posting/page/2/#post-108402)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
