WordPress.org

Ready to get started?Download WordPress

Forums

Disqus Comment System
Problem with featured posts due to disqus (2 posts)

  1. chetanbhasin777
    Member
    Posted 1 year ago #

    Hello! I have been using Disqus for a while now and this is the first time that I am in such problem.

    Whenever I activate the featured posts slider in WP-Genius theme and other similar themes after the post (in the slide show) another part is displayed (which is probably comment).

    Since, disqus comment system is not the default comment system of wordpress it does not retrieves anything else but this code.

    I can this code written on the featured box which comes out of nowhere. The code is as following:

    // <![CDATA[ var disqus_shortname = 'shortname_comes_here'; (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.com/forums/' + disqus_shortname + '/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); //]]>

    Pleas help me with this as soon as possible. How do you think I can solve this problem. I have tried re-installing the plugin.

    http://wordpress.org/extend/plugins/disqus-comment-system/

  2. DylanReeve
    Member
    Posted 1 year ago #

    I have the same problem.

    The issue is that Disqus has added an action to "loop_end" which is calling dsq_loop_end() from the plugin when the custom loop that runs for the featured posts.

    The way to fix it is to avoid using the standard WordPress loop in the feature posts section, but use a custom query instead. Have a look at the last example in this section: http://codex.wordpress.org/The_Loop#Multiple_Loops_Example_1

    Using the new WP_Query(...) method resolved the issue for me with a similar theme.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic