Forum breadcrumbs – You are here:Asgaros Support ForumTips & TricksShowing oldest sticky posts first
Showing oldest sticky posts first
Aussie@aussie
6 Posts
#1 · January 11, 2021, 8:38 am
Quote from Aussie on January 11, 2021, 8:38 amI needed to show my sticky posts in chronological order, with the oldest first. After a lot of hit and miss, I put this in my child functions.php file:
/* Sticky posts oldest first */ function custom_asgarosforum_filter_get_threads_order($order) { if ($current_post == "topic-sticky") { $order = 't.id DESC'; return $order; } else { $order = 't.id ASC'; return $order; } } add_filter('asgarosforum_filter_get_threads_order', 'custom_asgarosforum_filter_get_threads_order');Works like a charm.
I needed to show my sticky posts in chronological order, with the oldest first. After a lot of hit and miss, I put this in my child functions.php file:
/* Sticky posts oldest first */ function custom_asgarosforum_filter_get_threads_order($order) { if ($current_post == "topic-sticky") { $order = 't.id DESC'; return $order; } else { $order = 't.id ASC'; return $order; } } add_filter('asgarosforum_filter_get_threads_order', 'custom_asgarosforum_filter_get_threads_order');
Works like a charm.
Click for thumbs down.0Click for thumbs up.4
Last edited on January 11, 2021, 8:39 am by Aussie
Asgaros, Thierry and 2 other users have reacted to this post.
AsgarosThierryqualmy91coreyberry
coreyberry@coreyberry
1 Post
#2 · June 11, 2021, 4:11 am
Quote from coreyberry on June 11, 2021, 4:11 amQuote from Aussie happy wheels on January 11, 2021, 8:38 amI needed to show my sticky posts in chronological order, with the oldest first. After a lot of hit and miss, I put this in my child functions.php file:
/* Sticky posts oldest first */ function custom_asgarosforum_filter_get_threads_order($order) { if ($current_post == "topic-sticky") { $order = 't.id DESC'; return $order; } else { $order = 't.id ASC'; return $order; } } add_filter('asgarosforum_filter_get_threads_order', 'custom_asgarosforum_filter_get_threads_order');Works like a charm.
Yes, I think you’re right
Quote from Aussie happy wheels on January 11, 2021, 8:38 amI needed to show my sticky posts in chronological order, with the oldest first. After a lot of hit and miss, I put this in my child functions.php file:
/* Sticky posts oldest first */ function custom_asgarosforum_filter_get_threads_order($order) { if ($current_post == "topic-sticky") { $order = 't.id DESC'; return $order; } else { $order = 't.id ASC'; return $order; } } add_filter('asgarosforum_filter_get_threads_order', 'custom_asgarosforum_filter_get_threads_order');Works like a charm.
Yes, I think you’re right
Click for thumbs down.0Click for thumbs up.0