Skip to:
Content
Pages
Categories
Search
Top
Bottom

Custom sort members

Viewing 9 replies - 1 through 9 (of 9 total)

  • danbp
    Participant

    @danbp

    Hi,

    it’s explained here:

    Members Loop


    MastodontMedia
    Participant

    @mastodontmedia

    Yes, but I can’t seem to find anywhere to sort members alphabetically by Meta field?


    danbp
    Participant

    @danbp

    Have tried this ?

    <?php if ( bp_has_members( 'type = alphabetical' ) ) : ?>
        <?php while ( bp_members() ) : bp_the_member(); ?>

    MastodontMedia
    Participant

    @mastodontmedia

    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:


    danbp
    Participant

    @danbp

    That is also explained, with filter example, on the member loop codex page !

    See Filtering by Xprofile fields.


    MastodontMedia
    Participant

    @mastodontmedia

    I have googled exactly that and not found a comprehensible guide? Any clue where to find one?


    Henry Wright
    Moderator

    @henrywright

    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.


    mrgiblets
    Participant

    @mrgiblets

    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.


    ch1n3s3b0y
    Participant

    @ch1n3s3b0y

    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.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Custom sort members’ is closed to new replies.
Skip to toolbar