Tagged: pagination
The plugin is working great! But on the member type archives are not paginating. This may be my lack of knowledge, but when I limit the number of items in a page via the wp-admin dashboard (settings > Read …) it doesn’t seem to control the number of members shown in the user archive index page …
For example, I have a member type called Athlete, and the member index file just keeps growing non-stop without showing any pagination. Even though, in the wp-admin it is set to show 5 items, which is followed by the blog posts index page. Any idea where I can go to limit the item numbers in BuddyPress or your plugin so that I can control the number of items per page?
Also, keep in mind, I’ve customized the page quite a bit. So if you could guide me in the right direction (as you’ve done before) with some code example or functions to use, I’d appreciate it. Thanx in advance.
On behalf of Mical
MooseHi Moose,
Thank you for the question. BuddyPress does not uses the settings under reading.By default, BuddyPress will list 20 members on a single page. You can change that by filtering on has_members as below.
/** * Limit numbers of members per page. */ add_filter( 'bp_after_has_members_parse_args', function ( $args ) { $args['per_page'] = 5;// only show 5 members per page. return $args; } );
Hope that helps.
Regards
BrajeshOut of interest, where did you put that code? Im trying to make BP list all members not 20 at a time so hoping this will do it.
/**
* Limit numbers of members per page.
*/
add_filter( ‘bp_after_has_members_parse_args’, function ( $args ) {
$args[‘per_page’] = 200;// show 200 members per page.return $args;
} );Hi Derek,
The simple way to manage code is to use the code snippets plugin.https://wordpress.org/plugins/code-snippets/
You may also put that code in your child theme’s functions.php.
Regards
Brajesh
You must be logged in to reply to this topic.