Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #720574

    Hi,

    I have a category link integrated into the menu. How can I view posts in this category in reverse order (oldest post first)?

    Regards
    Morcy

    #720620

    Hi Morcy!

    Please take a look here
    http://wordpress.stackexchange.com/questions/82795/how-can-i-change-wp-main-archives-loop-to-sort-by-name-or-title

    at the second reply, there is a function you can use to customize the loop.

    Let us know if you will manage it!

    Best regards,
    Basilis

    #720902

    Hello!

    Thanks for the tip, but the use me not much. I would like to continue sorting the posts by date, only in reverse, chronological order.

    Regards
    Morcy

    #721573

    Hi Morcy,

    Try adding this at the bottom of functions.php:

    add_action( 'pre_get_posts', 'my_change_sort_order'); 
    function my_change_sort_order($query){
        if(is_category()):
           $query->set( 'order', 'ASC' );
        endif;    
    };

    Let us know if it helps :)

    Best regards,
    Nikko

    #721600

    Great! That works, I’m happy.
    The Kriesi support is the best.

    Thank you very much!

    Morcy

    #721698

    Hey Morcy,

    Glad we could help :)

    Regards,
    Nikko

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.