@BaraBajen – What version of bbPress are you using?
latest version, updated today
Are you using the plugin version for WordPress, or did you install it as a stand-alone piece of software?
Ah, sorry
Im using the plugin version – or atleast my question is concerning the plugin version
It would take a small plugin to piggy-back on top of bbPress. It would hook into the ‘bbp_has_replies_query’ filter, and switch the ‘order’ argument from ‘ASC’ to ‘DESC’.
Or, you can drop something like this in your functions.php file. (Note: Not tested, so this code might not actually work.)
function bbp_reverse_reply_order( $query = array() ) {
// Bail if no query
if ( empty( $query ) ) return;
// Change the order
$query = 'DESC';
// Return the adjusted query
return $query;
}
add_filter( 'bbp_has_replies_query', 'bbp_reverse_reply_order' );
Hmmm… slightly over my head (as it seems).
Is it possible to have this an option in admin – to mark if you want to have a certain topic or forum showing the replies in reverse order.
Anything is possible, but that’s plugin territory.
I am using this bbpress from last 6 months still I have not found any plugin regarding this. if You find it then please share with me.
To whomever wonders how to switch the order of replies. This filter actually works well, just the code needs to be modified to change the array value in $query[‘order’].
function bbp_reverse_reply_order( $query = array() ) {
$query['order']='DESC';
return $query;
}
add_fiter('bbp_has_replies_query','bbp_reverse_reply_order');
Hope, it helps someone.
Regards,
Alex
Where do i put this filter. Now I’,m back to my mission again. Just had a short, one and half year brake. 🙂
@Tapirk You need to create a new custom plugin and then paste the function into it. The easiest way to create a new custom plugin is to use Pluginception.
@tapirk Alternatively, you can also put this function with the filter into your theme’s functions.php file in case you don’t want to create a plugin.
How to order replies with a meka_key value.