views:

119

answers:

1

Hi,

I created a custom page template to display a filterable portfolio in Wordpress. However, on that custom page I am getting an error code -

// <![CDATA[ (function() { document.write('<script charset="utf-8" type="text/javascript" src="http://thinquetanque.disqus.com/get_num_replies_from_wpid.js?v=2.2&amp;amp;t=span&amp;amp;wpid0=14&amp;amp;wpid1=1"&gt;&lt;' + '/script>'); })(); //]]> 

I think this might be because the page uses a loop to display posts. And Disqus is set to only display on posts.

See the page at: http://thinquetanque.com/portfolio

Any ideas on how to prevent this?

thanks!

EDIT: I found the spot in the code where this is happening - but I don't know how to resolve the error.

<script type="text/javascript">
// <![CDATA[
    (function() {
        document.write('<script charset="utf-8" type="text/javascript" src="<?php echo dsq_js_comment_count_url().$post_id_str; ?>"><' + '/script>');

    })();
//]]>
</script>
A: 

Apparently, when using theme frameworks - such as hybrid, or in my case, canvas - there is some sort of issue with the following bit of disqus code:

add_action('loop_end', 'dsq_loop_end');

function dsq_js_comment_count_url() {
    return 'http://'.strtolower(get_option('disqus_forum_url')).'.'.DISQUS_DOMAIN.'/get_num_replies_from_wpid.js?v=2.2&amp;t=span'; }

I removed it from disqus.php on line 726. and voila - problem solved.

Jason
I think some javascript code adds `display: block` to your `<script` tag. This makes the disqus code visible. I don't think the error comes from Disqus, but from something else you use to get this layout.
Jan Fabry