Genesis Themes

  • Home
  • Genesis Tutorials
  • WP Tutorial
  • Twenty Fifteen Theme
  • Social Media
  • WP Plugins

Manually Display Disqus Comment Count in WordPress

Disqus Comment Count : To show the Disqus comment count in your WordPress blog,you need to modify some functions.When the user comment on your post,automatically count the number and displays.Using Disqus WordPress universal code,you can easily add the user's comment count.

Show Disqus comment Count in WordPress

Our intention here is to display the comment count for each post in WordPress.Make sure you should backup a copy of your theme files before editing files.Add the following code to your WordPress theme's footer.php . Make sure that this code should be added before  closing </body> tag.Finally don't forget to change your Disqus short name at the place of myg.

<script type="text/javascript">
 /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
 var disqus_shortname = 'myg'; // required: replace example with your blog short name
/* * * DON'T EDIT BELOW THIS LINE * * */
 (function () {
 var s = document.createElement('script'); s.async = true;
 s.type = 'text/javascript';
 s.src = '//' + disqus_shortname + '.disqus.com/count.js';
 (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
 }());
 </script>

It's isn't over yet.you need to add a bit of extra code to show comment count for posts with discus_thread.Open your single.php file and find the following code.

<a href="<?php comments_link(); ?>"><?php comments_number();?></a>

Replace the above code with the following code and save it. This is the best way to display Disqus comment count manually without using a plugin.

<a href="<?php the_permalink(); ?>#disqus_thread">Comments</a>

Related Posts

  • Top 10 Most Popular Google Adsense Alternatives 2016
  • How to Avoid CSS @Import in any WordPress Child Theme
  • How to Enable Gzip Compression in WordPress
  • How to Add Logo to Twenty Fourteen Theme
  • Speed Up Your WordPress Cache Without Plugins
  • Recommended WordPress Ping List 2017
  • Specify a Vary: Accept-Encoding header in WordPress
  • Best Settings for Async JS and CSS WordPress Plugin
  • Resources to Minify CSS in WordPress
  • Remove Query String from Static Resources in WordPress

Bluehost and Siteground Coupons for January 2016.

Best Premium WordPress Themes from TemplateMonster
download wordpress themes from MonsterOne

Categories

  • Blog
  • Blogger
  • Genesis Tutorials
  • Social Media
  • Top Websites
  • Twenty Fifteen WordPress Theme
  • WordPress Plugins
  • WordPress Tutorial