Member Loop only MemberPress members
I know there are quite a few topics already on excluding people from the Members Loop, but this one is a bit different.
I’m trying to exclude people who do not have MemberPress Memberships. I’ve seen several based on user role and extending the directory via a custom query (https://buddypress.org/support/topic/extend-bp_members-custom-query/), but nothing related to MemberPress. I’m really hoping I will not need to do as this custom query guy did it and ping my database for every member to see if a membership exists.
Here is how I’m attempting to do it without luck (within members-loop.php which is located in wp-content/themes/THEME/buddypress/members):
<?php while ( bp_members() ) : bp_the_member(); ?> <?php if(user_can(bp_get_member_user_id(), 'mepr-active', 'memberships: 36, 37, 38, 189, 198, 325, 1141, 1142, 1143, 1127, 1130, 1138')): ?>
- You must be logged in to reply to this topic.