Skip to content

How To Add Replies And Topics Count To bbPress

Just like most of the users, I love bbPress. It’s a great way to start a powerful forum within your WordPress blog without any external service or support. But just like most of the forums, bbPress needs some more features in it.

Every top forum software has or should have a Replies Created and Topics Started area below the topic replies, as seen in the featured image above. Here’s a way to add replies and topics count to bbPress.

Just add following snippet to your current theme’s functions.php file:

function display_counts () 
{

// delete or comment out these lines to stop displaying topic count

		$topic_count = bbp_get_user_topic_count_raw( bbp_get_reply_author_id( $reply_id )) ;
		echo "<br>Topics Started : " ;
		echo $topic_count ;
		echo "</br>" ;

// delete or comment out these lines to stop displaying replies count

		$reply_count = bbp_get_user_reply_count_raw( bbp_get_reply_author_id( $reply_id )) ;
		echo "<br>Replies Created : " ;
		echo $reply_count ;
		echo "</br>" ;
}
add_action ('bbp_theme_after_reply_author_details', 'display_counts') ;

You can add this snippet to bbPress core by editing the loop-single-reply.php file. I also posted a ticket about this issues at this link.

Leave a Reply

Your email address will not be published. Required fields are marked *