Is there a way to show the number of ❤️ in a WordPress template?

Function to link to the Discourse topic from a WordPress template? 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 :heart: 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.

2 Likes