• sainait

    (@sainait)


    Formally, WordPress shows latest posts in home page. I need to show oldest posts. Please Help. In my opinion, i should edit query which may be “SELECT… SORT BY post_date DESC LIMIT 10” to “SELECT … SORT BY post_date ASC LIMIT 10 “. But i did not find. And i don’t understand get_the_content function, where it passes argument (how many post to show) from and to.

    Please advice, and thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    In 2.1.x, look at wp-includes/query.php, around about line 890. This code:

    if ((empty($q['order'])) || ((strtoupper($q['order']) != 'ASC') && (strtoupper($q['order']) != 'DESC'))) {
    			$q['order']='DESC';
    		}

    That’s where it sets the default order of DESC if no order is specified exactly. Change it to this:

    if ((empty($q['order'])) || ((strtoupper($q['order']) != 'ASC') && (strtoupper($q['order']) != 'DESC'))) {
    			$q['order']='ASC';
    		}

    And it’s reversed, by default.

    If you’re still using 2.0.x, then it’ll be the same code, but in classes.php, around line 565 or so.

    Thread Starter sainait

    (@sainait)

    thanks. It works. Thank You Very Much.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Latest post to Oldest Post’ is closed to new replies.