Colon Theme Help Free theme

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

SH Started by Sean Hilferty · June 28, 2025 at 8:14 am · 1 reply 0 voices Last reply 1 year ago
SH
Sean Hilferty Original poster Member
#1

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.

ST
Spiracle Themes Original poster
#2

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

Join the conversation. Be kind — this is a public forum.

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

By posting, your reply becomes public (unless marked private).