Disqus Comment System
Disqus comment system showing weird code on my page (6 posts)

  1. julianrin
    Posted 5 years ago #

    If you look at my site at http://www.jerseycitypulse.com, you can see on the main box that there is some code showing on top of the picture. This was caused by Disqus, and it goes away when I deactivate the plugin. Does anyone know how to get rid of this? Thanks.

  2. robynsam
    Posted 5 years ago #

    I'm not seeing the code you're talking about. Maybe you deactivated the plugin? However, I did find a bug in the disqus plugin in the disqus.php file that may cause code to show up in sliders and front page.

    Remove this block of code at lines 1040 to 1062.

    <script type="text/javascript">
    	// <![CDATA[
    		var disqus_shortname = '<?php echo strtolower(get_option('disqus_forum_url')); ?>';
    		var disqus_domain = '<?php echo DISQUS_DOMAIN; ?>';
    		(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);
  3. julianrin
    Posted 5 years ago #

    Hey, I actually was able to fix it. There is an option to include the javascript in the footer, which has fixed it. Thanks for the reply though.

  4. robynsam
    Posted 5 years ago #

    Which version of disqus are you using? I'm using 2.61 and I don't see that option.

  5. julianrin
    Posted 5 years ago #

    I'm using 2.61 as well. Its on the advanced options page.

  6. xjosiax
    Posted 4 years ago #

    Genius. Worked for me. Thanks for that!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Disqus Comment System
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic