简体   繁体   English

仅显示评论数

[英]Display just the number of comments

I'm currently setting up DISQUS and would like to display the number of comments for a specific post. 我目前正在设置DISQUS,并希望显示特定帖子的评论数。

DISQUS provide a piece of code(http://docs.disqus.com/developers/universal/) to do this but it outputs in the format " 2 comments " DISQUS提供了一段代码(http://docs.disqus.com/developers/universal/)来执行此操作,但是它以“ 2 comments ”的格式输出

Does anyone know if it is possible to display just the number? 有人知道是否可以只显示数字吗? ie. 即。 without the word "Comments" 没有单词“ Comments”

The documentation is lacking. 缺少文档。

You can control the text that is rendered by changing the settings of your website on the Disqus admin (see http://disqus.com/admin/settings/appearance/ ). 您可以通过在Disqus管理员上更改网站的设置来控制呈现的文本(请参阅http://disqus.com/admin/settings/appearance/ )。

By putting the word "comments" inside a css class, you can then selectively render it where you want it to be visible, or set its style to {display: none} where you only want the number. 通过将单词“ comments”放入css类中,然后可以有选择地在希望其可见的位置呈现它,或者将其样式设置为{display:none},而只需要数字。 This is now described in detail in the recent disqus documentation (http://docs.disqus.com/help/3/). 现在,在最新的Disqus文档(http://docs.disqus.com/help/3/)中对此进行了详细描述。

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

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