Yes, but I can’t seem to find anywhere to sort members alphabetically by Meta field?
Have tried this ?
<?php if ( bp_has_members( 'type = alphabetical' ) ) : ?>
<?php while ( bp_members() ) : bp_the_member(); ?>
Yep, sorts the members alphabetically from the name, however I want to sort them by city which is the third meta field, see here http://distriktshovslagare.se/members/ I want to sort them by the field named Ort:
That is also explained, with filter example, on the member loop codex page !
See Filtering by Xprofile fields.
I have googled exactly that and not found a comprehensible guide? Any clue where to find one?
Hi @mastodontmedia
Look into using the bp_after_has_members_parse_args
filter. I think it’ll let you override the meta_key
and meta_value
params. That may help you do what you want?
See here for a tutorial on how to use the filter.
Hey @mastodontmedia, I’m using a clean install of BP 2.2.1 with WP 4.1.1 and members are sorted alphabetically by default.
Hi @mastodontmedia – I am having a similar sort of issue. I have a field ‘price’ that I want to sort by. I have read the article that @danbp kindly provided, but I am having a bit of an issue getting my head around it. I’m trying to create new ‘Order By’ effectively. I can create the option within the dropdown on the members loop and even get it to sort by price, but it then breaks plugins such as BP Profile Search, which works with the ‘out of the box’ Order By options.