• Resolved howardhuhn

    (@howardhuhn)


    I need to know how to arrange posts in a category by ascending date (earliest on top of page/latest on bottom – i.e. the opposite of the default date arrangement) Any ideas?

Viewing 2 replies - 1 through 2 (of 2 total)
  • You could use following code:

    <?php
    add_filter('posts_orderby', 'action_order_ascending');

    function action_order_ascending($orderby)
    {
    return 'post_date ASC';
    }
    ?>

    untested, but WordPress source says that it will work.

    Thread Starter howardhuhn

    (@howardhuhn)

    Didn’t get that to work, but I did figure it out, adjusting the Alphabetizing Posts script, I did the following
    <?php
    $posts = query_posts($query_string .
    ‘&orderby=date&order=asc&posts_per_page=-1’);
    if (have_posts()) : while (have_posts()) : the_post(); ?>

    This worked just fine.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Arranging posts by date ascending’ is closed to new replies.