Wow, worked like a charm. I wonder if someone could make this into plugin that does this for the group, memeber, and blog pages?
Thanks man.
Well, maybe it’s up to me then.
I just got it working for members, groups and blogs.
// add pagination links to the bottom of the groups directory
function add_bottom_group_pagination_links() {
?>
<div class="pagination" style="margin-top:5px;">
<div class="pag-count" id="group-dir-count">
<?php bp_groups_pagination_count() ?>
</div>
<div class="pagination-links" id="group-dir-pag">
<?php bp_groups_pagination_links() ?>
</div>
</div>
<?php
}
add_action( 'bp_after_groups_loop', 'add_bottom_group_pagination_links' );
// add pagination links to the bottom of the members directory
function add_bottom_member_pagination_links() {
?>
<div class="pagination" style="margin-top:5px;">
<div class="pag-count" id="member-dir-count">
<?php bp_members_pagination_count() ?>
</div>
<div class="pagination-links" id="member-dir-pag">
<?php bp_members_pagination_links() ?>
</div>
</div>
<?php
}
add_action( 'bp_after_members_loop', 'add_bottom_member_pagination_links' );
// add pagination links to the bottom of the blogs directory
function add_bottom_blog_pagination_links() {
?>
<div class="pagination" style="margin-top:5px;">
<div class="pag-count" id="blog-dir-count">
<?php bp_blogs_pagination_count() ?>
</div>
<div class="pagination-links" id="blog-dir-pag">
<?php bp_blogs_pagination_links() ?>
</div>
</div>
<?php
}
add_action( 'bp_after_blogs_loop', 'add_bottom_blog_pagination_links' );
Maybe I’ll spend my weekend writing my 1st BP plugin.
thanks. was looking for exactly this. i’ve been hardcoding this stuff…figured one day i’d need to start cleaning up the rummaged mess of files i have going. tx both
@paulhastings0 – I highly recommend diving in and writing your first plugin. It’s a bit of a tricky learning curve at first to put it into the WP plugin repository, but once you get the hang of it, it’s pretty cool. Thanks for doing the other ones.
and obviously for members you can do this:
// add pagination links to the bottom of the members directory
function add_bottom_members_pagination_links() {
?>
<?php
}
add_action( ‘bp_after_members_loop’, ‘add_bottom_members_pagination_links’ );
Would it be possible include forums as well?
@paulhastings0
@finni3 I think there’s a Trac ticket related to this: https://trac.buddypress.org/ticket/2472
I guess I must have missed that Paul. Thanks for the info.
Will this method still work in 1.2.6 and the forthcoming 1.2.7?
Oops reread the tittle and now the that it says groups. I’m looking for something which will do the same thing on individual forum topic pages.
That’s great.
Can you please do the same snippet for forum posts? My install (1.2. seems to have ajax pagination, and I need real pagination for SEO.
Further, how does one include the page number in the meta title tag?
eg “Fitness Forum Page 2”