# How to Add a View Counter in a Custom Discourse Theme?

**URL:** https://meta.discourse.org/t/how-to-add-a-view-counter-in-a-custom-discourse-theme/359658
**Category:** Development
**Created:** [March 31, 2025, 3:49pm UTC](https://meta.discourse.org/t/how-to-add-a-view-counter-in-a-custom-discourse-theme/359658 "2025-03-31T15:49:40Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [March 31, 2025, 11:17pm UTC](https://meta.discourse.org/t/how-to-add-a-view-counter-in-a-custom-discourse-theme/359658/4 "2025-03-31T23:17:16Z")

</div>

this might help

> [@Show Views instead of Replies](https://meta.discourse.org/t/show-views-instead-of-replies/187146/4):
>
> I went ahead and added a plugin outlet to make it extra easy: [https://github.com/discourse/discourse/pull/22238](https://github.com/discourse/discourse/pull/22238) If you add something like this to the Head section of a theme component, you’ll see it adds the views. You can add additional HTML if needed and style to taste from there slight_smile \<script type="text/x-handlebars" data-template-name="/connectors/above-latest-topic-list-item-post-count/views-count"\> {{topic.views}} views \</script\>

---

_[View the full topic](https://meta.discourse.org/t/how-to-add-a-view-counter-in-a-custom-discourse-theme/359658)._
