How to Display User’s Total Post Count in Each Post?

AI-generated summary

Philipp from the Discourse forum seeks to display a user’s total post count directly within each post, ideally near the username or avatar. After checking built-in settings and attempting theme customization with JavaScript, he finds no native option like user_stats or post_count available. David_Ghost and ondrej respond by sharing two existing plugins that address this need: discourse-custom-post-display and discourse-user-post-count. markschmucker notes growing interest in the feature and references a version of discourse-custom-post-display originally developed by @michaeld, which displays not only post count but also join date and likes — illustrated with an image. The community suggests these plugins as viable workarounds until an official solution may be considered. No built-in setting currently enables this functionality, so third-party plugins are the recommended path forward.

Hi Discourse Support Team,

I’m currently running a Discourse forum and I’d like to display the total number of posts a user has made directly in each post they create. Ideally, this should appear next to the username or under the avatar in the post view.

I’ve checked the settings under Admin > Settings > Users and Post Menu Hidden Items, but I couldn’t find an option like user_stats or post_count. I also tried customizing the theme with a poster-name:after widget and JavaScript API, but the post_count attribute doesn’t seem to be available.

Is there a built-in way to enable this, or do I need a plugin or specific API call? Any guidance would be appreciated!

Thanks in advance,
Philipp

Here you have 2 plugins available:

Hey Philipp welcome to Meta! :tada:

To save you looking for them in the topic linked above and for other people’s benefit, here they are :wink:

https://github.com/markschmucker/discourse-custom-post-display

https://github.com/Arkshine/discourse-user-post-count

There seems to be some interest in this. Not sure what the path is to making GitHub - markschmucker/discourse-custom-post-display · GitHub an official plugin.