Please or Register to create posts and topics.

Showing oldest sticky posts first

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.

Asgaros, Thierry and 2 other users have reacted to this post.
AsgarosThierryqualmy91coreyberry
Quote from Aussie happy wheels on January 11, 2021, 8:38 am

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.

Yes, I think you’re right