Disqus Comment System [Wordpress] - Cambia la palabra "Comentario"

i have installed Disqus comment system on one of my wordpress blogs, but i want the comment numbers to show as 0 en lugar de 0 Comments or 12 en lugar de 12 Comments. Previously there used to be an Appearance section in Disqus admin that used to have an option to change this output as was suggested in answer to esta pregunta. But seems like the Appearance section has been taken off by Disqus. Is there any other way to achieve this (without messing with the plugin code, ofcourse.) ??


Well, looked into the plugin source as well but no use, seems like they are updating it using javascript. After enabling Reactions now it returns 0 comments and 0 Reactions.


okie so i at last found where it is coming from ... the plugin basically includes a count.js archivos de yoursite.disqus.com\count.js?some wierd parameters, and the js file looks something like this:


if (typeof DISQUSWIDGETS != 'undefined') {
    DISQUSWIDGETS.displayCount({"showReactions": true, "text": {"and": "and", "reactions": {"zero": "0 Reactions", "multiple": "{num} Reactions", "one": "1 Reaction"}, "comments": {"zero": "0 Comments", "multiple": "{num} Comments", "one": "1 Comment"}}, "counts": [{"reactions": 0, "uid": 1, "comments": 0}, {"reactions": 0, "uid": 0, "comments": 0}, {"reactions": 0, "uid": 3, "comments": 0}, {"reactions": 0, "uid": 2, "comments": 0}, {"reactions": 0, "uid": 4, "comments": 0}]});

the worst part is we can't even change the code in the js file as it is hosted on disqus misma.

preguntado el 26 de agosto de 12 a las 01:08

3 Respuestas

Alternatively you can "hack" the code of Disqus. I'll try to explain what I did step-by-step:

  1. Get the newest file of the main disqus function. It should be something similar to this: http://disqus.com/forums/(your-site-id)/count.js
  2. Copy that script somewhere, you can "beautify it" to make it more readable. Than find and change the displayCount function to whatever you want to like this:

    c.displayCount = function (a)
      for (var b, c, e, g, f = 0; f < a.counts.length; f++)
      if (b = a.counts[f], c = h[b.uid]) e = b.comments === 0 ? "0 drivels" : b.comments == 1 ? "1 drivel" : "{num} drivels",
      g = e.replace("{num}", b.comments),
      a.showReactions && (e = b.reactions === 0 ? a.text.reactions.zero : b.reactions == 1 ? a.text.reactions.one : a.text.reactions.multiple, e !== "" && (g += " " + a.text.and + " " + e.replace("{num}", b.reactions))),
      c.element.innerHTML = g

    (note the drivels ;)

  3. Save (upload) the whole file somewhere on your server and remember the path

  4. Use Wordpress administration to edit the Disqus plugin - file disqus-comment-system/disqus.php and find line that contains concatenated url withthe word count.js. It is in about 3/4 of the file. As of now the line looks like this but it might change in the future:

    s.src = '//' + '<?php echo DISQUS_DOMAIN; ?>/forums/' + disqus_shortname + '/count.js';
  5. Make this link point to your newly-uploaded file like this (I used relative URL):

    s.src = '/wp-include/custom/disqus-count.js';
  6. Save it and profit! It took me more than an hour to figure this out so I hope this actually helps someone (I needed to translate these messages into my native language). A great benefit of this approach is the fact that if your language uses different word forms for different numbers (other than 0, 1 and more), you can script it in.

Respondido el 18 de enero de 13 a las 21:01

You should be able to hide it via JavaScript.

Algo en esta línea:

node = document.getElementsByClassName("dsq-comment-count")[0].childNodes[0]
node.nodeValue = node.nodeValue.replace("Comments", "")

Respondido 26 ago 12, 02:08

The official answer is here: http://help.disqus.com/customer/portal/articles/565624#customizing-link-text

  1. Ve a http://YOUR-SITE.disqus.com/admin/settings/?p=general

  2. Edit Comment Count Link section as you need.

  3. ¡Eso es todo!

Respondido 18 Oct 13, 02:10

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.