Disqus Comment Count Error Reviewed by Momizat on . Well the great thing about starting up a new website, with a new template and such is the amount of bugs you encounter during its development. Obviously not eve Well the great thing about starting up a new website, with a new template and such is the amount of bugs you encounter during its development. Obviously not eve Rating:
You Are Here: Home » Internet » Wordpress » Disqus Comment Count Error

Disqus Comment Count Error

Well the great thing about starting up a new website, with a new template and such is the amount of bugs you encounter during its development. Obviously not everything will just go as planned when you start using various plugins alongside your selected theme, and today we had noticed one that just looked quite weird.

We had decided to add a slideshow for our front page that displayed various videos that we had embedded onto our posts. It seemed simple enough since the theme we had already provided this, but the problem occurred when it was trying to grab the comment count from Disqus. It had started to display the following error:

// CDATA[ var disqus_shortname = ‘xxx’; var disqus_domain = ‘disqus.com’; (function () { var nodes = document.getElementsByTagName(‘span’); for (var i = 0, url; i < nodes.length; i++) { if (nodes[i].className.indexOf(‘dsq-postid’) != -1) { nodes[i].parentNode.setAttribute(‘data-disqus-identifier’, nodes[i].getAttribute(‘rel’)); url = nodes[i].parentNode.href.split(‘#’, 1); if (url.length == 1) { url = url[0]; } else { url = url[1]; } nodes[i].parentNode.href = url + ‘#disqus_thread’; } } var s = document.createElement(‘script’); s.async = true; s.type = ‘text/javascript’; s.src = ‘http://’ + disqus_domain + ‘/forums/’ + disqus_shortname + ‘/count.js’; (document.getElementsByTagName(‘HEAD’)[0] || document.getElementsByTagName(‘BODY’)[0]).appendChild(s); }()); //]]>

So it seems there was a slight issue in terms of compatibility, but fear not as the fix was quite simple. It seems that all you would need to do is enable a feature in the Disqus advanced options called “

Here’s how you fix it:

Go to your WordPress Dashboard

Go to Comments > Disqus

On the top right corner you will see Advanced Options

In here, enable the Output JavaScript in footeroption as the image below.

That should do the trick!

Clip to Evernote

About The Author

Number of Entries : 73
  • This is such a great resource that you are providing
    and you give it away for free. I love seeing websites that understand the value
    of providing a quality resource for free.

Scroll to top