I might try work out how do this. I’ve also been trying to work out for a few months how to do something similar to this – popular posts – sort posts in order from most favorited to least favorited. I finally found out how to do this yesterday after discovering this script by imath here:
https://github.com/imath/bp-loop-filters/blob/master/bp-loop-filters.php (see bottom half)
This allows you to do this:
// Example of displaying Popular posts (order posts by most favorited to least favorited)
function my_filter_activity( $loop ) {
if ( is_page( 'custom-page' )) {
$loop['meta_query'] = array(
array(
'key' => 'favorite_count',
'value' => 1,
'type' => 'numeric',
'compare' => '>='
),
);
}
return $loop;
}
add_filter( 'bp_after_has_activity_parse_args', 'my_filter_activity' );
Is it possible to order members by most followed to least followed by creating something very similar to the above code? Or does there need to be more work?
Brilliant, thanks, I’ll try it.