Display bbPress User Post Total

In most forum software you see a users post count underneath their name. bbPress does have this capability, but it requires a little theme customization. Check the piece of code below, you can use it inside your loop-single-reply.php to display the users post count.

if(!bbp_is_topic_anonymous()) {
    if(!bbp_is_reply_anonymous()) {
        $post_count = ( bbp_get_user_reply_count_raw ( bbp_get_reply_author_id ( bbp_get_reply_id() ) ) ) + ( bbp_get_user_topic_count_raw ( bbp_get_reply_author_id ( bbp_get_reply_id() ) ) );
        echo "Total Posts: " . $post_count;
    }
}

This will get the amount of topics a user has posted and the amount of replies, then add them together.

Good luck!

Comments