Fixing View Comments in Disqus Plugin

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.

Update #1: This is fixed to show how to do it in WordPress 3.1 and the current version of Disqus 2.61

Update #2: Please see the comment below from Rutgur for the latest fix

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 697 you will see this section of code:

function dsq_comments_text($comment_text) {
global $post;
 
if ( dsq_can_replace() ) {
return 'View Comments';
} else {
return $comment_text;
}
}

It’s the View Comments wording here that is displaying. Luckily we can easily change this to show the correct number of comments:

function dsq_comments_text($comment_text) {
global $post;
$number_of_comments = get_comments_number();
return $number_of_comments;
}

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.

Blog Comment Tools For The Talkative Blogger

Blog comments are often described as the life-blood of a blog. After all, a discussion is half the point of having a blog and interacting with people is one of the most enjoyable parts (see my post on Why You Should Leave Blog Comments to read more about this part of commenting).

Blog Comment Systems

These systems essentially take over the whole commenting section of WordPress, replacing it with their own features and style. Often they can be a little tricky to get looking the way you want them but offer features and enhancements that you can’t get through the standard WordPress system.

Disqus

Disqus

Probably the best known and most widely used (including on this site) blog comments system, Disqus allows your readers to login to your site using Facebook, Twitter, Yahoo, OpenID or just leave a comment the usual way. If they sign up for a Disqus account, the beauty is that they will be logged in to any website that uses Disqus. So it saves the pain of having to type your name, email and URL each time you comment on a new site, as your login details are carried over.

You can even set it to update the comments list in real-time, though I don’t have that feature at the moment.

I love how you can set it to auto-tweet out your comment with a link back, so people who are not part of the conversation can join in. It can also send to your Facebook updates, and you get email notifications when someone replies. I like how I can manage them like normal inside my WordPress dashboard, without going to another site (though it technically is loading an external site, it saves me going elsewhere). You can also customize it pretty easily if you know CSS.

That’s not to say it’s perfect. Some people have had problems with it loading correctly, often people can be confused by the new system, and I had problems of my own regarding email notifications when there was a system wide problem with Disqus.

Intense Debate

Intense Debate

Intense Debate is similar to Disqus but it is run by the folks who created WordPress. I used it for a short time but found that not many other sites used it. As it also allows you to be automatically logged in to other sites using the same system, like Disqus, I only found one other site I commented on that used Intense Debate. This massively negated the benefit of the system, and one Disqus has a big advantage with from the sheer number of sites using it.

It actually works very nicely and is easy-ish to customize and integrates very nicely with WordPress. But it won’t get more users until it has more users to make it worthwhile. If that makes sense.
[Just announced: Intense Debate users will be automatically logged in to comment on WordPress.com blogs. That’s one way to suddenly get logged into 10 million blogs…]

Echo

Echo

I actually had Echo (formerly called JS Kit Echo) installed for a while. At first I liked it and then I wrote a post about the ways I thought Echo could be improved. The system has many advantages, it pulls in blog comments and mentions from Twitter and Facebook (so do Disqus and Intense Debate), though it does this in real time without refreshing the page. You can include HTML, photos and even video in comments which is very nice, however it has some major flaws.

– Converting your old comments to the system is not quick, easy or perfect.
– You cannot manage them inside WordPress.
– You cannot edit them. Not even your own!
– You cannot separate trackbacks.
– You cannot have more than one level of threading.
– You cannot disable comments on an individual post or page.

These are hardly earth shattering features and most are ones already built into WordPress so it seems odd to take that functionality away. So it’s not recommended for the lack of basic features.

Overall
Disqus is my favorite choice and has some great improvements over the standard WordPress commenting system. However there are ways to “pimp” that system using plugins, that I’ll take a look at below.

Blog Comment Plugins

While the above are also plugins, they take over the whole commenting system of WordPress. If you’re using the in-built WordPress system then there are some plugins that will enhance your commentators experience. Akismet is the default anti-spam plugin that comes with WordPress, but below I’ll concentrate on functionality changes.

Action Comments

The first option in the image above is a great paid-for plugin called Action Comments (affiliate link so be wary of “upsell” offers on the page to try to bundle in other products you may not need). It’s pretty cheap and easy to install and set up. If the box is checked it will sign the person up for your email list (usually AWeber) and, if you have your list autoresponder set up, send them your free guide. This makes it easy for people to be added to your list, and provides a thank you to first time commentators.

Comment Luv

You may have seen the second item in the above image on many sites, where a Comment Luv check box and logo appears. It will automatically display the latest post from the URL you enter in the Website field of the comment form for other readers to see and potentially click on. There are even versions for Intense Debate and Echo (but not Disqus as far as I could tell).

Subscribe to Comments

One of the best plugins ever, Subscribe to Comments adds a checkbox underneath the comment box that allows the commentator to get emails when new comments are added (the bottom box on the above image). Bear in mind that if you’re logged in to your blog as the admin, you will not see this checkbox on your single post pages, more likely a message saying “You are the author of this entry. Manage Subscriptions”. Brilliant and indispensable.

Do Follow

If you want commentators to receive a backlink from your site as a thank you for leaving a comment, then the Sem DoFollow plugin will remove the default NoFollow attribute applied to links in comments. This may increase the number of messages you get, but also possibly increase the number of spam messages you get too as people comment only in order to gain a backlink.

AJAX Comments

If you feel your visitors will benefit from previewing their comment before submitting, then AJAX Comments Preview is a nice way of doing it without reloading the page. There is also AJAX Edit Comments, that goes even further, adding lots of inline editing options, but the latest version is paid-for.

Comment Timeout

One way of preventing spam on older posts is to close comments after a certain amount of time. Comment Timeout allows you to close them on old posts, but keep them open if they have had recently approved comments and are still popular with readers.

Extended Comment Options

If you feel you need more options for comments, such as editing settings for posts in bulk or automating closure of comments (similar to Comment Timeout), then try Extended Comment Options. It may not work on the latest version of WordPress. It did for me when testing but it’s not officially compatible yet.

Comment Rating

If you would like your readers to rate comments and help moderate them by flagging inappropriate messages, then Comment Rating allows you to allow them to do just that.

Simple CAPTCHA

Some people like to add a CAPTCHA verification form to the bottom of their comments form if they’re having trouble with spam that other plugins aren’t catching. The Simple CAPTCHA plugin easily adds one of these to your site, though beware, it could put people off from commenting. Again, it worked for me when testing but is not officially working for the latest WordPress version.

Blog Comment Hacks

Sometimes plugins aren’t enough, and you need to get dirty with the code to make the comments do what you would like. Don’t worry though, some of these are much easier than you would think!

Change Your Blog Comment Wording

Are you sick of seeing “0 Comments” and want to change it to be something more encouraging? Then follow my guide to changing default WordPress comment wording.

php code

Threaded Comments

Previously a plugin, now it is built in to WordPress (check it’s enabled under Settings > Discussion). Some themes still don’t support this, but you can easily add it with some know how. Kim has a great guide for how to add threaded comments to a theme here.

Change Author Comment Appearance

Often bloggers want to change how their own comments appear on their own blog so they stand out and can be noticed easily. This is now very simple in WordPress, just add a new CSS class and color for the author style. See this short guide on highlighting author comments.

Separate Comments and Trackbacks

I don’t like those nice trackbacks appearing as if they were a normal comment. To separate simply follow this guide to separating trackbacks from comments. Not for those who feel faint when viewing code, but it’s very easy.

Should I bother changing my blog comments?

It’s entirely up to you of course. Check our other people’s blogs, see what they do and see if you like it. Read Antti’s great post on how to get more blog comments and discussion, and then decide if you need to do something that makes it better and easier for you and your readers to get to know each other.

Have I missed any systems? Any other great blog plugins you know of? Are there any other useful hacks I haven’t mentioned?