# 如何在 WordPress 模板中显示 ❤️ 的数量？

**URL:** https://meta.discourse.org/t/is-there-a-way-to-show-the-number-of-in-a-wordpress-template/86292
**Category:** WordPress
**Created:** [2018 年4 月 27 日 08:57 UTC](https://meta.discourse.org/t/is-there-a-way-to-show-the-number-of-in-a-wordpress-template/86292 "2018-04-27T08:57:21Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### 作者： ![icaria36](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/icaria36/32/426431_2.png) [@icaria36](https://meta.discourse.org/u/icaria36)
#### 发布日期： [2018 年4 月 27 日 08:57 UTC](https://meta.discourse.org/t/is-there-a-way-to-show-the-number-of-in-a-wordpress-template/86292/1 "2018-04-27T08:57:21Z")

</div>

[Function to link to the Discourse topic from a WordPress template? - #2 by simon](https://meta.discourse.org/t/function-to-link-to-the-discourse-topic-from-a-wordpress-template/84790/2) is working just fine, showing the number of Discourse comments in the related WordPress pages.

I was wondering… is there a way to show the number of ❤ as well?

---

<div class="post-metadata">

### 作者： ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### 发布日期： [2018 年4 月 27 日 16:28 UTC](https://meta.discourse.org/t/is-there-a-way-to-show-the-number-of-in-a-wordpress-template/86292/2 "2018-04-27T16:28:57Z")

</div>

> [@icaria36](#):
>
> I was wondering… is there a way to show the number of ❤ as well?

Unfortunately, the topic like\_count is not returned with any of the methods that are retrieving data from Discourse. This is something that could be done, but it would require a separate API call to be made to Discourse. If this approach was taken, it would be important to cache the like\_count for a reasonable period of time, to keep WordPress from making a huge number of API requests to Discourse.
