简体   繁体   English

disqus 返回 0 评论

[英]disqus return 0 Comments

I have Place the following code before site's closing </body> tag:我在网站的结束</body>标记之前放置了以下代码:

  <script type="text/javascript">
    /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
    var disqus_shortname = 'MY_SHORT_NAME'; // required: replace example with your forum shortname

    /* * * DON'T EDIT BELOW THIS LINE * * */
    (function () {
        var s = document.createElement('script'); s.async = true;
        s.type = 'text/javascript';
        s.src = '//' + disqus_shortname + '.disqus.com/count.js';
        (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
    }());
    </script>

I did Append #disqus_thread to the href attribute in links.我确实将#disqus_thread附加到链接中的 href 属性。

<a href="http://foo.com/bar.html#disqus_thread">Link</a>.

and I try to add some comments to article but still returning 0 comments.我尝试在文章中添加一些评论,但仍然返回 0 条评论。

As you can see in Side "A" this is the front page where it should show the number of comments.正如您在“A”面所看到的,这是首页,它应该显示评论数量。

In Side "B" it's inside the article as you can see there is 2 comments but on the front page Side "A" it shows 0 comments.在“B”侧,它在文章内,如您所见,有 2 条评论,但在首页“A”侧显示 0 条评论。

屏幕截图

I've the same problem.我有同样的问题。 After changing url of the page comments counter start working correct.更改页面评论计数器的 url 后开始正常工作。 NOTICE: if you change url you will lost your comments注意:如果您更改网址,您将丢失您的评论

PS: make sure that you clear your cache =) PS:确保清除缓存 =)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM