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.

I"m working on modifying a theme that is based on 2010.

I want to make the posts on this blog display earliest to oldest, but I don't see how to do this in the theme:

I understand I need to add . "&order=ASC" to a wp_get_posts query, but I can't find any.

Just index.php: get_template_part( 'loop', 'index' );

and loop.php it seems to have the posts already: while ( have_posts() ) : the_post();

Where should I look?

share|improve this question
add comment

1 Answer 1

You can add code below to the beginning of loop.php

add_action('pre_get_posts', 'wpse_change_post_order');

function wpse_change_post_order($query){
    $query->set('order','ASC');
    $query->set('orderby','date');

}

the oldest posts will be in the home page.

share|improve this answer
add comment

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.