How to sort members list by xprofile value?
if ( bp_has_members( bp_ajax_querystring( 'members' ) ) ) : do_action( 'bp_before_directory_members_list' ); while ( bp_members() ) : bp_the_member(); // the loop content goes here endwhile; do_action( 'bp_after_directory_members_list' ); bp_member_hidden_fields(); else: // and then the were none endif;
Let’s say we have a simple members loop code just like the one above. And let’s say that all of our members have this xprofile field named “Lucky Number” filled accordingly.
Can we sort out the loop output so it displays members with highest “Lucky Number” first?
- You must be logged in to reply to this topic.