I’ve made no secret of the fact I love the Disqus commenting system plugin. However each time I upgrade it I have to go through the same rigmarole of changing the plugin due to one specific problem. So this will explain how I fix the View Comments problem in the Disqus plugin for WordPress.
The Problem
On my Blog page the comment count works fine, as you can see in this picture:

The 44 text is displaying perfectly on the Blog, category and archive pages. However on the single post page by default instead of the comment count it says View Comments and is cut off, as you can see below.

So to fix this (or at least change it to the way I prefer, as some people may prefer it saying View Comments), inside the wp-content/plugins/disqus-comment-system folder you need to edit the disqus.php file. For those not comfortable doing this, make a backup or you can always re-install a new copy of the plugin if things go wrong. On line 485 you will see this section of code:
return ‘<span class="dsq-postid-’.$post->ID.‘">View Comments</span>’;
} else {
It’s the View Comments wording here that is displaying. Luckily we can easily change this to the comment count by simply exchanging View Comments with ‘.$comment_text.’.
return ‘<span class="dsq-postid-’.$post->ID.‘">’.$comment_text.‘</span>’;
} else {
So once done, my single post page now looks correct, displaying the number of comments:

There, looks lovely again. This isn’t really a bug as it’s designed to say View Comments there, however in the default WordPress comment system this would show the number of comments here, so we are simply re-creating that functionality.







