DISQUS

The Disqus Blog: How to show Disqus comment widget under every post on WordPress index page

  • ericbogs · 1 year ago
    Ping.
  • ericbogs · 11 months ago
    Ping.
  • ericbogs · 11 months ago
    Ping
  • ericbogs · 10 months ago
    I attempted to add the Disqus comment widget underneath every post on my Wordpress index page. I don't like forcing users to click through to the individual post page just to see/add comments.

    It's pretty easy to get the basic logic working (just needed to override the is_single_post() check in the Wordpress & Disquss comments.php files), but I ran into a few problems on the Disqus JS side:

    1) The Disqus JS inserts into globally-named DOM IDs, rather than post-specific IDs. I don't think I can change this on my end. On an index page with 10 posts, this causes 10 Disqus comment widgets to be inserted after the first post.
    2) The JS bloat is predictably big, as it's re-downloading 2 JS files for each comment widget. In the long-run, I'd want to include one JS total (perhaps pass in several post IDs).

    Other feedback:

    1) You might consider a JS minimizer that at least strips out comments but also compresses your code.
    2) You might consider at the very least one JS download for functionality, and another one for comment data. It's not clear to me why you need to JS downloads.

    Ideally, for fast loading, it would be great to have a solution like this:

    1) User visits my blog index page
    2) They scan down to, say, the 6th post
    3) They see the "3 comments" link, and click it
    4) Either through AJAX (preferred) or iFrame (still not too bad), we display the Disqus comment widget for that post
    5) User submits comment, widget remains open.
    6) User can potentailly have several widgets open at same time.

    Thanks guys!