• I’m new to WordPress and just setting up my site. I found the Mystique theme, and love it, but there seems to be a problem with the search results page when using the Disqus comment system, as you’ll see if you visit my site: https://paranoimia.co.uk – the search results page is broken.

    I’ve tried disabling all other plugins, so I know this is the cause. I also know why – it’s returning broken HTML – but I’m not sure where I need to look to fix it.

    This is the offending part of the code on the search results page:

    <body class="	<script type="text/javascript">
    	// <![CDATA[
    		var disqus_shortname = 'paranoimia';
    		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 = 'https://' + disqus_domain + '/forums/' + disqus_shortname + '/count.js';
    			(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
    		}());
    	//]]>
    	</script>
    
    search search-no-results col-2-right fixed loggedin browser-gecko">

    In my search to find a solution, I’ve seen other sites using Mystique and Disqus, and their searches work fine. I’ve also got Mystique on a local installation, with nothing else but Disqus installed, and the same problem occurs.

    Any help would be much appreciated.

  • The topic ‘Mystique theme breaks when searching when using Disqus comments’ is closed to new replies.