Display total number of Disqus comments on a page in Drupal 7
On this site I decided to use the commenting platform Disqus. I wanted to display the comment count for each page, but unfortunately the module doesn't allow this straight out of the box. To do this, follow these 3 steps.
Make sure you replace 'MYTHEME' with your theme name and 'example' with your disqus shortname. (If you don't know your Disqus shortname login to disqus > admin > settings > general > site identity)
Now we need to add the following
<a>tag in the
<a>tag on the page.
<?php <a href="<?php print $node_url; ?>#disqus_thread" data-disqus-identifier="<?php print $node->disqus['identifier']; ?>"></a> ?>
Finally we need to adjust the way Disqus displays the comment count and reactions. To do this login to disqus > admin > settings > general > comment count link / reaction count link. To display just the numbers it will look something like this.