Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

After I complete a collection of posts, can I reorder them in reverse to read from the top (oldest post) to bottom (newest post)?

share|improve this question

1 Answer 1

You can reverse the order of the main query via the pre_get_posts action:

function wpa85668_ascending_order( $query ) {
    if ( $query->is_home() && $query->is_main_query() )
        $query->set( 'order', 'ASC' );
}
add_action( 'pre_get_posts', 'wpa85668_ascending_order' );

If it's a custom query, just set the order query var to ASC in the arguments passed to the query.

share|improve this answer
    
Thanks for answering a newbie-researched question. I'll try your suggestion. –  user27384 Feb 13 '13 at 20:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.