I have a Buddypress install on which we’re using the blog posts as a classifieds system. I needed a way for users to leave feedback for one another (as in “I paid and this person never sent my stuff” type feedback), and got a ton of help creating a plugin that auto-creates a post when a user registers, and titles it with their username (for easy linking from their BP profile page). I have it creating a post to a custom post type I created called “feedback”. This is all working fantastically.
Now I’d like to display a comment count for the post titled with a user’s login name on their profile. I do know about the codex page on displaying comment count, but that only works within the loop, and I need to put this comment count in my themes/bp-child/members/single/member-header.php
I need the “Feedback” button to read “Feedback (n)”, with n being the number of comments on the post titled “justbishop” (obviously, the username in all of this would have to change when viewing another member’s profile).
I received some guidance already in the #wordpress IRC channel, and was lead to THIS, which is supposed to grab the post ID using the post title (which in my case needs to be,
bp_get_displayed_user_username()), but I’ve yet to find a piece of code to put into my template file to make this all work the way I’d like it to.
- The topic ‘Displaying Comment Count for a Post on BP Profile’ is closed to new replies.