The solution that I figured out few minutes ago and worked for me (SEO purpose):
<?php
$loc = "http://disqus.com/api/3.0/users/details.json?user=<YOUR_USER_ID_HERE>&api_key=<YOUR_API_KEY>";
$json = file_get_contents($loc);
$json_array = (array)(json_decode($json));
//print_r($json_array);
$comments_number = $json_array['response']->numPosts;
?>
And in my templete I used <?php echo $comments_number; ?>.
I used Disqus Plugin for WordPress (checked the JavaScript files in footer) and added the shortname as is.
Worked for me!
(@will24_)
11 years, 10 months ago
I have been scouring the internet trying to find a solution to this, but to no avail; none of worked for me.
The comment count for a disqus thread is never correct on the homepage – it always says “Leave a comment” even if there are multiple comments. Anyone have any idea how to fix this? I’ve found a few solutions on the internet involving editing content.php and disqus.php, but none have worked for me.
https://wordpress.org/plugins/disqus-comment-system/