WordPress DISQUS plugin show incorrent comments count

Some month ago i reviewed the WordPress DISQIS plugin. After a while, during the development of a new clean theme for my personal blog, i noticed that the function get_comments_number() was not returning an interger number  and that also the function comments_text() was returning “View Comments” instead of the correct text…. panic!

If searched the web for “WordPress DISQUS plugin comments count problem” for a few days until i decided to watch inside the WordPress comments API and to come with a  solution by myself. It’s very strange that this problem hasn’t yet been fixed by the DISQUS team.

The patch is simple, you need to manually patch the disqus.php file inside the WordPress DISQUS plugin directory, /wp-content/plugins/disqus-comment-system/.

Then look for the function “dsq_comments_number()“, this should just “return $count” instead of HTML code.

Finally look for the function “dsq_comments_text()” and replace the “View Comments” string with the variale $comment_text.

You’re done, save the WordPress DISQUS plugin code and you’ve finally fixed the incorrect comments count problem now.

Well done!


WordPress DISQUS plugin show incorrent comments count, 3.7 out of 5 based on 3 ratings
GD Star Rating