Members Directory Pagination Help!
-
Hi All,
I’m currently trying to filter users of a certain role from my members directory in buddypress; I’ve managed to write a function (member_loop_role) which returns their role and then I filter against that in members-loop.php with the following code:
<?php while ( bp_members() ) : bp_the_member(); ?> <?php if ( member_loop_role() == 'bbp_blocked') continue; ?>
This removes any user with the role of bbp_blocked (bbpress blocked role). However pagination on the members directory still counts all the users which I’m hiding, meaning you get some pages showing members 1-20; but only listing a portion of those users; naturally this caused major inconsistency from page to page.
I know pagination is handled by the functions bp_members_pagination_count() and bp_get_members_pagination_count() in bp-members-template.php however no matter what I try I simply can’t understand how that code works or how to make it reduce the member count by the number of user’s I’ve hidden from the members directory.
Can anyone help with this? really desperate to get this sorted and I’ve been trying for weeks without success.. I’m sure one of you guys will look at those above function and know the fix in an instant; but I simply don’t have the PHP experience. Thanks in advance for any help you can provide!
- The topic ‘Members Directory Pagination Help!’ is closed to new replies.