Am still trying to find out how to do this. I’ve had a look at various themes and not found one that has it.
Can anyone at least tell if it’s possible to do this with Buddypress?
I still can’t figure out how or if this is possible – can anyone help?
Anything’s possible
You won’t be able to do it with `bp_the_topic_pagination()` because that function requires that you are inside of a single topic loop, which you’re not.
Try something like:
`global $forum_template;
$per_page = 5;
$total_posts = $forum_template->topic->topic_posts;
$pag_links = paginate_links( array(
‘base’ => add_query_arg( array( ‘topic_page’ => ‘%#%’, ‘num’ => (int) $per_page ), bp_get_the_topic_permalink() ),
‘format’ => ”,
‘total’ => ceil( (int) $total_posts / (int) $per_page ),
‘mid_size’ => 1
) );
echo $pag_links;`
@boonebgorges Thanks for the reply!
I’m not quite sure how to use your solution, though. is it something that goes in functions.php? If so, how do I then use it in the theme?
If you want to use it in a theme, try putting it in a function wrapper and then calling that function in your template. In functions.php:
`function bbg_forum_pag() {
global $forum_template;
$per_page = 5;
$total_posts = $forum_template->topic->topic_posts;
$pag_links = paginate_links( array(
‘base’ => add_query_arg( array( ‘topic_page’ => ‘%#%’, ‘num’ => (int) $per_page ), bp_get_the_topic_permalink() ),
‘format’ => ”,
‘total’ => ceil( (int) $total_posts / (int) $per_page ),
‘mid_size’ => 1
) );
echo $pag_links;
}`
Then in your template:
“
@boonebgorges Works perfectly – thanks very much!