如何使用我的Wordpress主题中的注释计数覆盖disqus注释计数

时间:2012-05-22 10:37:55

标签: php wordpress wordpress-theming disqus

我的第一个问题!我想将主题左侧的disqus“1 Comentario y 0 Reacciones”覆盖到评论计数。它看起来像image attached

我在数据库中搜索了类似的问题,但没有运气。

如果您想结帐,请my blog in the test server

我试图将此代码放在我主题的functions.php中,因此Disqus不会覆盖主题中的注释。

// Disqus: Prevent from replacing comment count
remove_filter('comments_number', 'dsq_comments_text');
remove_filter('get_comments_number', 'dsq_comments_number');
remove_action('loop_end', 'dsq_loop_end');

还在Disqus插件的高级选项中输出Javascript选项,但没有运气。希望有人帮助我(我会欠你一杯啤酒!)

更新:显然问题出现在家庭,类别,搜索页面上,但不在单个帖子中。

2 个答案:

答案 0 :(得分:1)

可能this blog post会帮助您。

答案 1 :(得分:0)

好看@ dInGd0nG帖link之后我找到了简单解决方案来解决这个问题。只需转到wordpress主题的functions.php并插入此代码段:

// Disqus: Prevent from replacing comment count
remove_filter('comments_number', 'dsq_comments_text');
remove_filter('get_comments_number', 'dsq_comments_number');
remove_action('loop_end', 'dsq_loop_end');

这就是全部。而且它比从Disqus插件进入高级选项卡并在页脚中输出Javascript更好,因为这会使它变慢。

相关问题