Загрузка страницы

How to Display Comment Counts on Your Site

Learn more: https://help.disqus.com/developer/adding-comment-count-links-to-your-home-page

TRANSCRIPT

Let readers know where discussions are happening by showing the comment count for articles on your homepage.

In this tutorial, I’m going to walk you through the steps to implement comment counts on your site.

For this example, I’ll be using the Disqus blog.

#1. count.js code snippet (0:15)
To get started, we will need to add a single line of JavaScript code to our site’s homepage template.

Here’s the code snippet we’ll be adding.

You can copy this from either the Universal Code installation instructions page in your Disqus Admin or in our Knowledge Base article.

#2. Update code snippet with your shortname (0:29)
Make sure to update the snippet with your site’s shortname.

You can find your shortname in the General Settings.

#3. Paste code snippet in your site's template (0:37)
Next up: Paste the code snippet before the closing body tag in your site’s template. You’ll need to add it to every page where you want comment counts to appear.

On the Disqus Blog, we use Hubspot as our CMS. We’re going to add the snippet to the Footer HTML for Blog Listing Pages.

#4. Append #disqus_thread to article links where you want comment counts to appear (0:55)

Finally, add article links ending in # (hash) disqus_thread to your site’s template where you want the counts to appear. This lets Disqus know which article to look up and return the corresponding comment count.

For the Disqus Blog, we’re going to add the counts beneath the article titles.

Let’s check the blog now. Looks like the comment counts are showing. When readers click the link, they’ll be able to load the article and jump directly to the discussion.

#5. Customize comment count text (1:24)
If you’d like to customize the comment count text, you can do that in your Community Settings.

For example, if an article has no comments, you can change the default text to a call-to-action.

This is also useful for translating the text for your site’s specific language.

I hope you found this tutorial helpful. If you’d like to learn how to add comment counts to non-link elements or use identifiers for generating counts, check out our knowledge base. Thanks for watching.

Видео How to Display Comment Counts on Your Site канала Disqus
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
26 июня 2018 г. 23:17:33
00:01:54
Яндекс.Метрика