Reputation: 491
In BuddyPress, it shows 20 members per members directory page. I want to list 24 members per page with a pagination and sorting must work perfectly. I tried:
bp_has_members(bp_ajax_querystring('members').'per_page=24'))
It works but pagination and sorting are not working correctly.
Upvotes: 0
Views: 2278
Reputation: 11
To modify this file, you make a copy of it and put it into your child-theme /your-child-theme/buddypress/members/members-loop.php
Upvotes: 0
Reputation: 86
For those like me wondering how to do this nowadays and ending here after searching with their fav engine, the proper way is to use a filter in bp-custom.php or the functions.php of your theme. Cf. https://codex.buddypress.org/developer/using-bp_parse_args-to-filter-buddypress-template-loops/
For the member loop it would be something like :
function my_bp_members_per_page( $retval ) {
$retval['per_page'] = 24;
return $retval;
}
add_filter( 'bp_after_has_members_parse_args', 'my_bp_members_per_page' );
Bonus : this will still work if you use cache like WP Rocket. Former method doesn't work with cache and logged in user.
Upvotes: 3
Reputation: 1956
You need an '&' for each additional argument. Try:
bp_has_members(bp_ajax_querystring('members').'&per_page=24'))
Upvotes: 2