Skip to:
Content
Pages
Categories
Search
Top
Bottom

Filter Members List Based On Profile Field

  • @kizzywizzy

    Participant

    I don’t believe Ive found working examples of this. Members who selected Cats as their owned pet should see other cat owners and members who selected dogs should only see other dog owners.

    <?php if ( bp_has_members( bp_ajax_querystring( 'members' ). '&per_page='.sq_option('buddypress_perpage') ) ) : ?>

Viewing 9 replies - 1 through 9 (of 9 total)
  • @shanebp

    Moderator

    example:

    BP_User_Query

    @kizzywizzy

    Participant

    Hi Shane. Thank you for that lead. Using the example given Ive successfully filtered my diretory but I cannot make it so that members who selected CAT can only see others who selected CAT in the directory. I guess I need an example of how to put this conditional into t he members loop.

    @shanebp

    Moderator

    Please use https://gist.github.com/ to show us what you have so far.

    @kizzywizzy

    Participant

    @shanebp

    Moderator

    I’ve added a comment to your gist.
    If you’re storing the field as a string that is ‘Male’ or ‘Female’, it should be fine.
    Otherwise you’ll have to make a few tweaks.

    @kizzywizzy

    Participant

    Thank you Shane. Topic is resolved.

    @latinosamorir

    Participant

    Hi @kizzywizzy.

    Thank you for bringing this up.

    I’m interested in created an additional Member Directory (keep default, and have a new page with a custom member directory).

    In this new Custom Member Directory, I would like to do something similar to what you’re doing (filter members based on loggedin member profile fields). Basically create a list of Member Suggestions.

    Any idea on how to use the code you’re provided to make the above happen?

    Thank you!

    @latinosamorir

    Participant

    Hi.

    Anyone willing to help?

    Thank you!

    Giovanni

    @damienoneill2001

    Participant

    Hey @latinosamorir

    Were you able to find a solution to this?

    Damien

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Filter Members List Based On Profile Field’ is closed to new replies.
Skip to toolbar