Reverse Blog Archive Order? (Oldest-to-Newest)

Sean Hilferty June 28, 2025 at 8:14 am

I’m trying to post a story in blog format. So I want the posts to display in “chapter” order. But the “blog archive” page lists NEWEST-first — which means the archive page will list the chapters in reverse order, adding later chapters to the TOP of the list.

I tried changing the dates so the list is correct — but then the next/previous links are reverse of the chapter order. 🙁

It seems to me there must be a way to reverse the posts archive list so it displays oldest-to-newest, but I can’t find it in the Colon Plus theme controls or page edit options. Is there a way to do this? I can even do some coding/scripting, if necessary, but I don’t know where to look in the theme files.

Replies (1)

  1. Sean Hilferty June 28, 2025 at 8:14 am

    I’m trying to post a story in blog format. So I want the posts to display in “chapter” order. But the “blog archive” page lists NEWEST-first — which means the archive page will list the chapters in reverse order, adding later chapters to the TOP of the list.

    I tried changing the dates so the list is correct — but then the next/previous links are reverse of the chapter order. 🙁

    It seems to me there must be a way to reverse the posts archive list so it displays oldest-to-newest, but I can’t find it in the Colon Plus theme controls or page edit options. Is there a way to do this? I can even do some coding/scripting, if necessary, but I don’t know where to look in the theme files.

  2. Spiracle Themes June 30, 2025 at 5:52 am

    Hi Sean

    Thanks for reaching out. You have to use the following code in order to reverse the blog posts by date.

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

    Please follow the steps to do that:

    Step1) Install and activate the plugin called Code Snippets. (https://wordpress.org/plugins/code-snippets/)
    Step 2) Then add a new PHP snippet
    Step 3) Addd Name to it and add the code above
    Step 4) Click on Save changes and make sure to select “Only run on site front-end”.

    Screenshot: https://prnt.sc/KBJ55pqEyp_8

    Best Regards

Post a Reply

Reply To: Reverse Blog Archive Order? (Oldest-to-Newest)
Your information: