Load Disqus Comments on Demand

Tutorial on how to setup Disqus Comment system on Wordpress to load on demand.

Tutorial on how to setup Disqus Comment system on Wordpress to load on demand
Most WordPress sites use Disqus as their commenting system. The easiest way to implement Disqus on your website is to use their plugin.

Since Disqus loads asynchronously, your web page load speeds are not affected. However, Disqus downloads required files to the user’s system, which adds the weight of posts/pages where you have implemented Disqus codes. This costs your users their valuable bandwidth.

There are numerous other posts on internet related to the topic. The one I liked the most is from Labnol. However, in his post he didn’t mention how to dynamically get post url, post ID etc. We bring you a code snippet that you can place in your theme’s “functions.php” file.


Place the below code in your theme’s “functions.php” file or your site-specific plugin. Remember to change the short name from “aneejian” to your Disqus short name - line highlighted in code
var disqus_shortname = "your disqus short name";


Place the below code where you want Disqus to load. This will show a link “Load Comments” where you have placed the code. Clicking the link will load comments.
You can place it in your theme’s “comments.php” file or “single.php” file or you can use a plugin that can insert codes to your post/pages.



AngularJS,3,Automation Testing,8,Blue Prism,1,CSharp,5,Disqus,1,Excel,3,Excel Addin,1,HP ALM,5,HTML5,1,ISTQB,2,Java Script,2,Manual Testing,7,Photography,1,Quiz,2,REST API,5,Robotic Process Automation,2,RPA,2,Testing,15,UFT,8,UiPath,1,VB,5,VBScript,1,VSTO,1,Wordpress,1,
Aneejian: Load Disqus Comments on Demand
Load Disqus Comments on Demand
Tutorial on how to setup Disqus Comment system on Wordpress to load on demand.
Loaded All Posts No posts found VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU ARCHIVE SEARCH ALL POSTS No post found which matches with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy