in User Experience

Change Disqus Comment Count Text

I recently implemented the Disqus comment system on this and another of my blogs. I am really pleased with the service. It works extremely well, allows me to moderate all of the comments on my multiple blogs and my online conversations in one location, and the user interface is seriously kick-ass. My only complaint was that there is no way to change the look of the Comments and Reactions count. Or so I thought. Thanks to Ryan at Disqus, I learned there is a very simple, but admittedly unknown, way to do this.

It turns out that in the Settings section for your Disqus approved sites, you can change the text of the comment counts. That part is well known. What is not well known is that the text fields where you change the text will accept HTML.

NOTE: You can find the settings to which I refer in this post by logging into your Disqus.com account. From your Dashboard, click on the site for which you want to implement this change from the section labeled “Your Sites”, then click the “Settings” tab at the top of the page. Then click on the “Appearance” tab in the left-hand side of the page. The Comments and Reactions count settings are towards the bottom of the page.

In my case, I wanted to show only the integer value that represents the comment count. I do, however, have Reactions enabled so the text output for the count looks something like this:

10 Comments and 8 Reactions.

The settings allows me to change each part but it won’t let me show only the “10” form the example above. The example above is represented in the settings via two text fields containing one each of “10 Comments” and “8 Reactions”. You can delete the contents of the “Reactions” field, but Disqus will still display the “and” even if the field is empty.

The Workaround

The work around is to add an opening SPAN tag to the end of the “10 Comments” field and a close SPAN tag to the “8 Reactions” field like this:

10 <span class="hide">Comments
8 Reactions</span>

So when the fields are concatenated in the page, the output will look like this:

10 <span class="hide"> and 8 Reactions</span>

The form even allows you to add custom CSS in the handy textarea labeled “Custom CSS”. So I can simply add the following code to hide the text enclosed in my SPANs:

.hide { display: none; }

Note that There are three text fields for comments and three for reactions.

0 Comments
1 Comment
{num} Comments

0 Reactions
1 Reaction
{num} Reactions

Make sure you enter the HTML in each field like this:

0 <span class="hide">Comments
1 <span class="hide">Comment
{num} <span class="hide">Comments

0 Reactions</span>
1 Reaction</span>
{num} Reactions</span>

This trick could also be used to change the look of the different parts of the string as well. You could do something like this:

{num} <span class="comments">Comments</span>

<span class="reactions">{num} Reactions</span>

The output of the above would look like this:

{num} <span class="comments">Comments</span> and
<span class="reactions">{num}Reactions</span>



		
									

Leave a Reply

12 Comments

  1. You can change the text in your Disqus appearance settings, see “Comment count link text”: http://dl.dropbox.com/u/13552259/Screenshots/0ow.png

    Is there any limitation to this which you’re looking to address? We’re happy to take any feedback or provide some help working with it.

    • Hey Ryan. Thanks for the comment. I’m blown away you guys noticed my little plugin.

      Yes, I know you can change the text as you describe, but if you select to display Comments and Reactions, it seems that the “count” will always be some variation of ‘% Comments and % Reations’ The way I have my blog designed, the comment count appears in a 40px X 40px icon next to each blog post title. I wanted to show only the comment count. I tried setting the Reaction values to empty fields, which worked, but I still get “% Comments and “. I could change my design but I would really prefer not to. If there was an option (or if there /is/ an option) to specify which of the fields to display in the count, that would be ideal.

      • Understood — there would be more user-friendly ways to do this which we’ll keep in mind as we make improvements, but for now there is a workaround.

        You can use HTML in the comment count text which means that you can wrap certain words in a custom class for some CSS-targeting. For example, if you wanted reactions but didn’t want to display that text you could enter the following: http://dl.dropbox.com/u/13552259/Screenshots/0oy.png

        Note: the comment count text areas are staggered to show the whole thing

        It ends up looking similar to this on the page:

        0 Comments and

        Now you can use some custom CSS to hide everything in that span.

          • Awesome, man. It’s a really useful tip. I saw where a few others were looking for a way to do this too. I’m really impressed with the quick reaction and helpful attitude. A rarity.

    • What would be truly awesome would be a mechanism for theming the Comment count via a simple JavaScript callback. Your system is one of the nicest web services and apps I have ever worked with. I am a BIG fan so I’m not trying to be at all disparaging.

  2. jimmy choo bridaland  jimmy choo outlet Nike Lebron shoes andNike ZOOM LeBron  new burberry replica burberry lebron 8 v2i want to look some pandora jewellery; pandora  jewellery beads cheap  nfl jerseys or jersey supply and religion jeans, you can leave a email  to me! thank you! nike air max 2011white air maxnike griffey maxreligions jeanstrue religions jeans true religion jeans outletbears jersey blackhawks jerseyken griffey shoes air griffey maxken griffey jr shoes
    air griffey max 2lebron 8 south beach,cheap Nike Air Max 2009cheap Nike Air Max 2010cheap Nike Air Max 2011cheap Nike Air Max 24 -7cheap Nike Air Max 360cheap Nike Air Max 87cheap Nike Air Max 88 Mencheap Nike Air Max 89 Mencheap Nike Air Max 90cheap Nike Air Max 91 Mencheap Nike Air Max 92 Mencheap Nike Air Max 93 Mencheap Nike Air Max 95
    cheap Nike Air Max ACGcheap Nike Air Max Classic BWcheap Nike Air Max LTDcheap Nike Air Max Preview EU Mencheap Nike Air Max Skyline Mencheap Nike Air Max Tn Mencheap Nike Air Zenyth Mencheap Nike Griffey MaxNike Griffey max,Nike TN 2011,Nike air max skyline,bape shoes,Adidas Shoes 2011,Air Griffey Max Fury 2012,Air Jordan High Heels,black Air Jordan Shoes,Air Jordan Wool Boots
    Jordan CMFT Max 12Leather,cheap Jordan Sandals,Ken Griffey Jr Jerseys,Ken Griffey Shoes 2011,Ken Griffey Shoes Womens,Nike ACG Boots sale,cheap Nike Aina Chukka,Nike Air 1/2 Cent Penny,Nike Air Foamposite One,Nike Air Max 2009 shoes,Nike Air Max 2010 shoes,Nike Air Max 24-7 shoes
    white Nike Air Max 95,cheap Nike Air Max 95 Boots,Nike Air Max NM Nomo,Nike Air Max Uptempo 97,cheap Nike Heels for Women,Nike Ken Griffey Shoes
    Nike TN 2011 shoes ,Nike Zoom Lebron shoes,Women’s Nike Dunk SB

    cheap Pandora Necklacescheap Pandora Ringscheap Pandora Setscheap Pondora Packages
    herve leger bandage dressesmoncler down jacketmoncler doudounesmoncler coatcheap moncler jacket

    lebron 8 south beach
    Nike ZOOM LeBron
    Nike Lebron shoes
    lebron 8 v2Nike Air Max LeBron 8 V2

    detroit lions jersey
    cheap authentic jerseys
    cheap nfl jerseys
    youth nfl jerseys
    nfl jerseys wholesale
    religion jeans outlet
    true religion store
    true religions
    true religion billy
    true religion men
    men Bootcut jeans
    men Flare jeans
    men Skinny jeans
    straight leg jean
    true religion women
    women bootcut jeans
    women Flare jeans
    cut off jeans shorts
    girls skinny jeans
    straight legs jeans
    nike shox shoes
    sb dunks
    true religion joey
    true religions jeans
    true religion men jeans
    cheap religion jeans
    cheap true religion men jeans
    true religion boys jeans
    true religion billy mens
    true religion cargo pants
    true religion corduroy jeans
    true religion capris
    true religion joey jeans
    cheap religion jeans
    true religion mens skinny
    True Religion Straight Leg
    true religion womens jeans
    true religion denim jeans
    true religion denim shorts
    true religion straight leg jeans
    True Religion Wide Leg
    skinny bootcut jeans
    True Religion lizzy
    True Religion joey rainbow
    True Religion casey legging
    True Religion lone star
    True Religion stella

    True Religion shirts for women

    true religion brand
    cheap true religion jeans
    true religion brand jeans
    true religion uk
    moncler vest
    moncler uk
    moncler women jackets
    moncler men jackets

  3. This post is amazing, thanks for sharing this!

    I wish I could manage disqus plugin to be WPML compatile!