How to override a disqus comment count with the comment count from my WordPress theme

My first question here! I want to override the disqus “1 Comentario y 0 Reacciones” from the left part of the theme to just the comment count. It shoud look like the image attached.

I have searched the database for a similar problem but no luck.

Read More

Here is my blog in the test server if you want to check out.

I have tried to put this code in the functions.php of my theme so the Disqus doesn’t override the comments from the theme.

// 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');

Also the output Javascript option in the Advanced options of the Disqus plugin, But no luck with that. Hope someone help me (I will owe you a beer!)

Update: Apparently the problem happens in the home, category, search pages but not in the single post.

Related posts

Leave a Reply

1 comment

  1. Ok after looking @dInGd0nG post link I found the simple solution to this problem. Just go to functions.php of your wordpress theme and insert this snippet:

    // 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');
    

    That’s all. And it’s better than going to the Advanced tab from the Disqus plugin and outputting the Javascript in the footer, since that would make it slower.