Forum breadcrumbs - You are here:Asgaros Support ForumTips & TricksShowing oldest sticky posts first
Showing oldest sticky posts first
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.