Skip to:
Content
Pages
Categories
Search
Top
Bottom

Total number of posts


  • Fugglet
    Participant

    @fugglet

    Hello again dear Buddypress support forum.

    I would like to show total posts under people’s name and avatar in the forum session.

    I’ve googled this quite a bit, most posts were 2years + old, and didn’t work for me.

    Does anyone have a neat little way of doing this trick in funtions.php file or something like that?

    Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)

  • Fugglet
    Participant

    @fugglet

    I’d rather avoid using a plugin for this.


    Henry Wright
    Moderator

    @henrywright

    Hey @fugglet

    Pop this into your template:

    echo count_user_posts( bp_displayed_user_id() )

    Note, if bp_displayed_user_id() doesn’t work in that particular context then you’ll need an alternative way of getting the member’s ID.


    Fugglet
    Participant

    @fugglet

    Do I post this in my functions.php?


    Henry Wright
    Moderator

    @henrywright

    No. It goes into your template. So for example, if you wanted to display the count in your member profile header, then you’d put it in member-header.php.

    Take a look at this article for more info on the BP template hierarchy for how to set up templates (if you don’t have them already).


    Fugglet
    Participant

    @fugglet

    I don’t see anything with that directs me towards my avatar area in the forum.
    I’d like to place it under the avatar.
    Same deal for my website http://blazeplay.com/forums/topic/hi/

    Isn’t that something you should do inside the buddypress or bbpress files? It might just be me being a bit confused here.

    Or can I see which file it’s in by using Firebug in Firefox or similar?


    Henry Wright
    Moderator

    @henrywright

    I must admit, the template hierarchy was slightly confusing at first for me too but once you get your head around it, it is a very powerful way of using templates. It works similarly to the WordPress template hierarchy if that helps.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Total number of posts’ is closed to new replies.
Skip to toolbar