我从来没有使用过wordpress插件。但我使用了仅 JS 版本。
通过执行以下操作,您可以让仅 JS 的 Disqus 快速运行。
将此 JS 添加到您的页面。
<script type="text/javascript">
//<![CDATA[
(function() {
var links = document.getElementsByTagName('a');
var query = '?';
for(var i = 0; i < links.length; i++) {
if(links[i].href.indexOf('#disqus_thread') >= 0) {
query += 'url' + i + '=' + encodeURIComponent(links[i].href) + '&';
}
}
document.write('<script charset="utf-8" type="text/javascript" src="http://disqus.com/forums/ohu/get_num_replies.js' + query + '"></' + 'script>');
})();
//]]>
</script>
将此代码添加到您希望显示评论的位置(可能在帖子文本下方)
<div id="disqus_thread"></div><script type="text/javascript" src="http://disqus.com/forums/ohu/embed.js"></script><noscript><a href="http://disqus.com/forums/ohu/?url=ref">View the discussion thread.</a></noscript><a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
最后 - 让评论计数显示。您需要做的就是将#disqus_thread附加到任何标签中的永久链接URL...例如...
<a href="domain.com/article">Comments</a>
会成为...
<a href="domain.com/article#disqus_thread">Comments</a>
这将用 x 评论替换“评论”...(x 是该帖子的评论数量)。
我对 wordpress 模板有点生疏,所以我不能 100% 确定你会把所有这些放在哪里。但是,如果您还有其他问题,我可以尝试提供帮助。