WordPress.org

Support

Support » Plugins and Hacks » Disqus Comment System » [Plugin: Disqus Comment System] Disqus comment system showing weird code on my page

[Plugin: Disqus Comment System] Disqus comment system showing weird code on my page

  • 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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • 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);
    		}());
    	//]]>
    	</script>

    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.

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

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

    Genius. Worked for me. Thanks for that!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Disqus Comment System] Disqus comment system showing weird code on my page’ is closed to new replies.
Skip to toolbar