1. Home
  2. Knowledge Base
  3. Customizations
  4. PHP Functions
  5. How to Display the Number of Discussions under Sub-Forums in the Forums List Widget

How to Display the Number of Discussions under Sub-Forums in the Forums List Widget

Introduction

BuddyBoss does not provide an option to display the number of discussions (topics) under sub-forums when using the BB Forums List Widget. However, you can enable this functionality by adding a small custom function to your active theme. This will allow the widget to show topic counts for each sub-forum, making forum activity more visible to users. This guide explains how to display the number of discussions under sub-forums in BuddyBoss to improve forum clarity, navigation, and user engagement. Enable it today.

Custom Workaround

Before proceeding, make sure you have a complete site backup.

  1. Go to Appearance > Theme Editor in your WordPress admin dashboard.
  2. Under Select theme to edit, choose your active theme (preferably a BuddyBoss Child Theme), then click Select.
  3. From the Theme Files list, open Theme Functions (functions.php).
  4. Add the following code just before the closing PHP tag (?>):
add_filter( 'bbp_after_list_forums_parse_args', 'bb_show_sub_forum_count' );

function bb_show_sub_forum_count( $args ) {

    $args['show_topic_count'] = true;

    return $args;

}
  1. Click Update File to save the changes.

Once added, the Forums List Widget will display the number of discussions under each sub-forum.

Note: Modifications are typically considered custom work, but we are making an exception in this case. Please review the BuddyBoss Support Policy.

Troubleshooting and FAQs

Q: The discussion count is still not showing.
A: Ensure the code is added to your child theme’s functions.php file and not the parent theme. Clear any caching plugins and refresh the page containing the Forums List Widget.

Q: Does this affect forum pages outside of the widget?
A: No. This change only affects the Forums List Widget display.

Q: Will this impact performance?
A: The impact is minimal. However, on very large forums, displaying additional counts may slightly increase query usage.

Q: Can I revert this change easily?
A: Yes. Simply remove or comment out the code from functions.php and save the file.

Was this article helpful?

Related Articles

Subscribe to Our Newsletter

Stay In Touch

Subscribe to our Newsletter, and we’ll send you the latest news from BuddyBoss

  • This field is hidden when viewing the form
  • This field is for validation purposes and should be left unchanged.

To speak to our Agency consultant, fill in the form found at our Contact Page.

  • Get Started

    Enter your name and email address to get started with your project...

  • This field is for validation purposes and should be left unchanged.