Question

In BuddyPress, the members directory is split into pages. For example, the first 20 members are displayed on page 1, the second 20 members are displayed on page 2 and so on.

So, on a website with 112 members, I would expect there to be a total of 6 pages to the members directory. This will obviously change as new members join the site.

Is there a way to programmatically get the total number of pages?

Was it helpful?

Solution

Try this snippet:

<?php echo round((int)bp_get_total_member_count()/(int)get_option('posts_per_page'));?>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top