bbPress: Topics and Replies per Page
Changes how many topics a forum page lists and how many replies a topic page shows, independent of the bbPress settings screen.
Opens WPIDE on
Code
if ( ! function_exists( 'bbp_get_topics_per_page' ) ) {
return;
}
$wpide_bbp_topics_per_page = 30;
$wpide_bbp_replies_per_page = 25;
add_filter( 'bbp_get_topics_per_page', function () use ( $wpide_bbp_topics_per_page ) {
return $wpide_bbp_topics_per_page;
} );
add_filter( 'bbp_get_replies_per_page', function () use ( $wpide_bbp_replies_per_page ) {
return $wpide_bbp_replies_per_page;
} );
Notes
Large numbers make pages heavier; 20 to 50 is a good range.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.