# איך להוסיף מונה צפיות בעיצוב Discourse מותאם אישית?

**URL:** https://meta.discourse.org/t/how-to-add-a-view-counter-in-a-custom-discourse-theme/359658
**Category:** Development
**Created:** [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:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Kajan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kajan/32/496687_2.png) [@Kajan](https://meta.discourse.org/u/Kajan)
#### Post date: [31 במרץ,‏ 2025,‏ 3:49pm UTC](https://meta.discourse.org/t/how-to-add-a-view-counter-in-a-custom-discourse-theme/359658/1 "2025-03-31T15:49:40Z")

</div>

I am using a custom Discourse theme and want to display the number of views for each topic. The default Discourse setup includes this feature, but it is not visible in my theme.

I checked the template files and found a section where column headers for sorting topics include an option for views. However, I can’t find where the actual number of views is being displayed in the theme.

How can I add the view count to my theme? Where should I insert the correct code to make it appear? Also, is there a way to do this without modifying the core files, only using theme components or available customization options?

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [31 במרץ,‏ 2025,‏ 11:14pm UTC](https://meta.discourse.org/t/how-to-add-a-view-counter-in-a-custom-discourse-theme/359658/3 "2025-03-31T23:14:11Z")

</div>

IIRC post views is one of the arguments of a post. I did this a while back to fetch some other data, but I made a mental note that you can get the views the same way.

Using `this.args` will do this. Display it to see what are the arguments, and the views should be one of the arguments.

I know this is a kind of a non-answer, but I hope it points you in the right direction.

* * *

In the event this is not what you are talking about, is it okay to send a screenshot with what you are trying to achieve? By default, the topic list shows the views counter.

---

<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: [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\>
