I think a link to the site showing it would be easier for us to help.
Pascal.
I’m not able to link to the site directly right now, unfortunately, but this is what the source looks like for the pagination area:
<div class="bbp-pagination-links">
<p> <span class="page-numbers current">1</span><br>
<a class="page-numbers" href="https://www.com/topic/test-1/page/2/">2</a><br>
<a class="next page-numbers" href="https://www.com/topic/test-1/page/2/">→</a>
</p></div>
This is the pagination for a list of topics, right ? (and not for the search).
EDIT: and you did NOT copy a bbPress template into your own (child) theme but use the standard php files ?
If you could confirm the above ?
And then, if you put the below in your functions.php, what do you get ?
function casiepa_custom_pagination( $args ) {
$args['type'] = 'list'; // try also 'plain'
$args['after_page_number'] = ' ';
return $args;
}
add_filter( 'bbp_topic_pagination', 'casiepa_custom_pagination' );
This is not from the search, though I wouldn’t be surprised if it does the same thing there as well. It does it for the pagination for a list of topics, yes, but also for the list of replies when viewing a topic (and when listing pages of a topic beneath the topic title when viewing a forum).
I am using child theme files. However, I see the pagination functions defined in:
/wp-content/plugins/bbpress/includes/topics/template.php
/wp-content/plugins/bbpress/includes/replies/template.php
etc… and those files, of course, are not among my child theme files.
I tried your function, and it did add a space after each page number (though inside the anchor tag, not after it). It didn’t, however, removed the <br> tags. I tried plain as well as list, as commented.
Thanks for your help so far.
Any other ideas, by chance?
Unfortunately not.
Do you have the possibility to switch to a standard wordpress theme ?
Or deactivate all plugins except bbPress ? Then reactivate one by one
Pascal.
I just had something with exactly the same issue. Are you using the flatsome theme ?
Pascal.
I’m not, I am using a child theme of Twenty Twelve that I’ve been creating.
I actually got this figured out, on a whim I decided to try your $args[‘type’] = ‘list’; again and for whatever reason this time it worked. I don’t know if I may have just overlooked it the first time, or what.
My function:
function bbp_custom_pagination_links( $args ) {
$args['type'] = 'list';
return $args;
}
add_filter ('bbp_topic_pagination','bbp_custom_pagination_links');
I will still have to go through and do the same thing for other instances of pagination within bbPress, but that has worked for the topic list. It’s just a matter of styling the list elements with CSS at that point to get them aligned horizontally.
Thanks for all of your help, I really do appreciate it.
I got the pagination for topics and for replies above/below each respective loop working, but I can’t seem to find out how to hook into this one to apply the same effect:
That’s the pagination for topic replies listed right beneath the topic’s title when viewing a single forum.
Any ideas?