In the last post, I told the way to implement Disqus Combination widget to your web site which have recent comments, popular threads and commented users, all in one. But, if you only need one of it, why load all 3 of them. So, if you only want the Recent Comments widget, you will find this post useful.
Screenshot
You can also see a demo on JsFiddle.
The Code
Insert the following code in the place where you want to display the widget :
<div id="RecentComments" class="dsq-widget">
<h2>Recent Comments</h2>
<script type="text/javascript" src="https://example.disqus.com/recent_comments_widget.js?num_items=5&hide_mods=0&hide_avatars=0&avatar_size=32&excerpt_length=100"></script>
</div>
You should replace the “example.disqus.com” with your Disqus forum URL ( “shortname.disqus.com” ).
Configure
As I said in my previous post, this widget also supports configuration like the “Combination Widget”.
Name |
num_items |
hide_mods |
excerpt_length |
hide_avatars |
avatar_size |
You can add this code in Blogger, WordPress and any other Blogging services.
Blogger
Go to your Blogger Blog -> Layout and click on the “Add a Gadget” button. Choose “HTML/JavaScript” widget :
Then, paste the code and click “Save” button.