Jul 25, 2021 4:00 pm
I am using Q&A layout in my site. This layout ranks the answers according to votes. Namely, if the first answer takes less vote it ranks below. If an answer gets more vots it rises up. But I want them to be ranked from early answer to late answer from top to bottom, like other layouts. Is it possible?
2 Replies
Jul 27, 2021 7:01 am
You can put this hook code in the functions.php file of your current active WordPress theme or use Code Snippets plugin to insert this code. Delete all caches, then delete wpForo cache in Dashboard > Forums > Dashboard admin page.
add_filter('wpforo_post_list_args', function ($args){
if(!empty($args) && !isset($_GET['orderby'])){
$args['orderby'] = '`is_first_post` DESC, `created` ASC, `postid` ASC';
}
return $args;
});
Jul 27, 2021 2:46 pm
Thank you very much. It worked.