BlogThemes

How to Prevent Disqus from overriding your WordPress Comment Count

Disqus, a remark platform, tends to exit and alter the feedback quantity hook for WordPress. This may increasingly find yourself inflicting your theme to point out the textual content “View Feedback” as a substitute of the particular remark depend that you really want it to point out. The rationale why Disqus tries to exchange the remark depend proven by WordPress is that it will likely be out of sync with the precise remark depend on many events. So by having these substitute settings, your remark counts ought to match what they’re in Disqus nevertheless eliminating this substitute settings will make your pages load quicker. Just lately, we had a possibility to work on a shopper’s web site that had this difficulty ruining the styling of their feedback depend field. On this article, we are going to present you tips on how to forestall Disqus from overriding your WordPress Remark Depend in themes.

After doing plenty of search over the web (together with the GetSatisfaction varieties for Disqus), we noticed that almost all locations on the net advised that we go within the Superior Choices tab and activate this JavaScript possibility for remark counts which ought to repair the issue. You will get to the Disqus superior choices tab by going to Feedback &raquo Disqus (look on the highest proper nook of the display screen). Confer with the picture beneath:

Disqus Advanced Options Panel

This selection will output a JavaScript in your theme’s footer. So be sure that the footer.php file truly has wp_footer(); perform in there. Most themes may have that in there, however sadly the one we have been working with didn’t. So we had so as to add it in. This may clear up the difficulty. On each web page load the textual content “View Feedback” will present up then it will likely be changed in a break up second with the precise remark depend. Nonetheless, if you happen to discover your web page load time would get slower.

After doing additional analysis, we ended up on Themehybrid Boards the place Adam Capriola advised another. First it’s essential open your theme’s features.php file and paste the next codes:

1
2
3
4
// Disqus: Stop from changing remark depend
remove_filter('comments_number', 'dsq_comments_text');
remove_filter('get_comments_number', 'dsq_comments_number');
remove_action('loop_end', 'dsq_loop_end');

Your remark depend is likely to be off if you happen to do that. So you must go in your Discussions setting and disable Trackbacks. Additionally verify the packing containers that claims commenters should be registered they usually will need to have a beforehand authorized remark.

That was fairly a little bit of problem to be sure that we get the proper remark depend quantity in our WordPress themes.

Download The WPSaviour App Now

Related posts
Beginner’s GuideBest WordPress PluginsBlog

9 Best Social Proof Plugins for WordPress & WooCommerce (2020)

Tips

How To Disable The WordPress User Admin Toolbar

Tips

WordPress Front Page vs Homepage

Tips

5 Things You Must Avoid Doing in WordPress

Leave a Reply

Your email address will not be published.

Pay in your preferred currency
Indian rupee
Euro