Another alternative Add Comment Disqus Blogger

Updated on April 09, 2016

There are many ways to implement the code a widget in Blogger, one of which is how to store the code comments Disqus. If you follow the instructions on the page Disqus, the code is stored in the gadget sidebar commentary blog. If you want valid HTML5, you can follow how to install comments Disqus at this post . Read also: Now Disqus It Back Can Import Comments Blogger
Author: Adhy Suriady

And if you want to try an alternative way to install comments Disqus and remain valid HTML5, please follow the steps in below. Please copy the code below
            <b:includable id='disqus-comment' var='post'>
            <script type='text/javascript'>
                var disqus_blogger_current_url = &quot;<data:blog.canonicalUrl/>&quot;;
                if (!disqus_blogger_current_url.length) {
                    disqus_blogger_current_url = &quot;<data:blog.url/>&quot;;
                }
                var disqus_blogger_homepage_url = &quot;<data:blog.homepageUrl/>&quot;;
                var disqus_blogger_canonical_homepage_url = &quot;<data:blog.canonicalHomepageUrl/>&quot;;
            </script>
            </b:includable>
And please keep the above code that you copied earlier under the following code:
            <b:includable id='comments' var='post'>
            ..............
            ..............
            </b:includable>
So the rates will be as follows:
            <b:includable id='comments' var='post'>
            ..............
            ..............
            </b:includable>
            <b:includable id='disqus-comment' var='post'>
            <script type='text/javascript'>
                var disqus_blogger_current_url = &quot;<data:blog.canonicalUrl/>&quot;;
                if (!disqus_blogger_current_url.length) {
                    disqus_blogger_current_url = &quot;<data:blog.url/>&quot;;
                }
                var disqus_blogger_homepage_url = &quot;<data:blog.homepageUrl/>&quot;;
                var disqus_blogger_canonical_homepage_url = &quot;<data:blog.canonicalHomepageUrl/>&quot;;
            </script>
            </b:includable>
Then save the code below the above code </body>
<script type='text/javascript'>
var disqus_shortname = &quot;kompiajaib&quot;;
!function(){var e=document.createElement(&quot;script&quot;);e.type=&quot;text/javascript&quot;,e.async=!0,e.src=&quot;//&quot;+disqus_shortname+&quot;.disqus.com/blogger_index.js&quot;,(document.getElementsByTagName(&quot;head&quot;)[0]||document.getElementsByTagName(&quot;body&quot;)[0]).appendChild(e)}();
</script>
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<script type='text/javascript'>
!function(){var e=document.createElement(&quot;script&quot;);e.type=&quot;text/javascript&quot;,e.async=!0,e.src=&quot;//&quot;+disqus_shortname+&quot;.disqus.com/blogger_item.js&quot;,(document.getElementsByTagName(&quot;head&quot;)[0]||document.getElementsByTagName(&quot;body&quot;)[0]).appendChild(e)}();
</script>
</b:if>
Change the code kompiajaib by Disqus username of your blog. Then to eliminate Blogger comments, please add the code display: none in CSS #comments as follows:
#comments{....................;display:none}
And lastly, to store and display the Disqus comment on the post pages please find the code below or something similar like that:
            <b:includable id='comments' var='post'>
             <div class='comments' id='comments'>
Then save the code below just below the above code.
<b:include data='post' name='disqus-comment'/>
So the rates will be as follows:
            <b:includable id='comments' var='post'>
             <div class='comments' id='comments'>
<b:include data='post' name='disqus-comment'/>
................
................
</b:includable>
Done, now please save your blog's HTML editing. With the way over, you no longer need to install count.js of Disqus if you want to display the number of comments on the front page for each posting. All you need is the code to display the number of Disqus comments on the front page. 
Please use the code below to display the number of Disqus comments;
<a expr:href='data:post.url + &quot;#disqus_thread&quot;' title='Comments Count'/>
Share this: pinterest