Skip to:

Re: How do you show a member's total post count?



Thanks @boonebgorges and @3sixty — I went with @3sixty’s solution and decided to make a copy of the function for the post count and then call them out as separate “Forum Topics” and “Forum Replies” counts, rather than totaled together, in the yellow activity bar on the member profile page like this:

<span class="activity">
<?php bp_last_activity( bp_displayed_user_id() ) ?>
| Forum Topics: <?php echo get_new_forum_topic_count_by_user( bp_current_user_id() ) ?>
| Forum Replies: <?php echo get_new_forum_post_count_by_user( bp_current_user_id() ) ?>

This works well, as you can see on the member pages at I decided to forgo adding the post count to the topic list anyway, so I’m all set.

The only bit of information I would have liked to have added to the member profile pages is a count of blog posts, which I figured out easily enough, but to only have that count display on the member profiles of those members who have permission to post to the blog, which on this site is only 3 out of over 200 members. So for the three members who have blog posts, there would be an added count, like this, “Blog posts: 46”, but for all other users instead of saying “Blog posts: 0”, I tried to craft a conditional tag but I couldn’t get it to work right — the count just kept showing up on all user profile pages. Any ideas?

Skip to toolbar