Skip to:
Content
Pages
Categories
Search
Top
Bottom

Display post count in sidebar for author ID

  • @natehawkes

    Participant

    How do I display an author’s post count in a sidebar? I am trying to make a widget that shows the number of posts an author has made (as well as the number of blog posts they have made). I currently only have a local copy of the site, but will be putting it online very soon for demonstration.

    In my sidebar, I am using bbp_get_user_oost_count() and feeding the author ID using get_the_author_meta(‘ID’), but the post count is coming back as 0, even though I have made a topic in the forum and posted a reply to that topic. Is there a way to get the post count into my widget? It will appear in my sidebar and show the number of posts for the author, not the logged in user.

    Thanks in advance.

    Nate

Viewing 3 replies - 1 through 3 (of 3 total)
  • @henrywright

    Moderator

    Hi @natehawkes

    Do you mean blog post count?

    echo count_user_posts( bp_displayed_user_id() );

    @natehawkes

    Participant

    @henrywright No, it’s in relation to a post I made on the main WordPress forum: https://wordpress.org/support/topic/author-box-outside-of-the-loop?replies=1. Since then, I have found all the functions apart from the number of forum posts. I have only now realised that I posted this in BuddyPress, and not bbPress, which is the area I am looking for. I have both the blog posts and the blog comments working, and I also have my friends count displaying, but not the forum posts.

    @henrywright

    Moderator

    @natehawkes right, I see… Yes, somebody in the bbPress forum should be able to help!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display post count in sidebar for author ID’ is closed to new replies.
Skip to toolbar