Filter members loop
I would like to filter the members loop after clicking on a link. The filtering itself isn’t the problem because its well documented (https://codex.buddypress.org/developer/loops-reference/the-members-loop/). I just don’t know how to apply the filter and where to write the code.
For instance my members have the xprofile fields gender and pet. On my homepage I have the following:
<a href="#">All male members who have poodles</a>
After clicking on this a new page should be opened which displays all male members with poodles.
1. How can I tell the new page what should be filtered?
2. How can I filter for more than one field. In the doc there’s this
<?php if ( bp_has_members( my_custom_ids( $field_name, $field_value ) ) ) : ?>
Can I enter more than one $field_name and $field_value (male and poodle)?
3. Which template do I have to use for the custom members loop?
Thanks in advance!
- The topic ‘Filter members loop’ is closed to new replies.