Вопрос

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?

Это было полезно?

Решение

Try this snippet:

<?php echo round((int)bp_get_total_member_count()/(int)get_option('posts_per_page'));?>
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top