How to Add Disqus Comment In WordPress Without Plugins

Actually to Add Disqus comments in WordPress do not need a headache and difficult. Disqus itself already provides plugins to facilitate the installation of Disqus comments in WordPress. However there are some WordPress users (including me hehehe …) trying not to install many plugins in WordPress if it can still be installed without plugins including Disqus comments.

Disqus Comment on WordPress

To post Disqus comments in WordPress without plugins, it can actually use the universal code provided by Disqus. But there needs to be additional other code so that Disqus can blend with WordPress system.

Well, to put Disqus comments on WordPress without plugins, please use the codes below.

Please not single.php file and search for code</main> then please keep the code below above the code above.

<div id=”disqus-comments”>
<div id=”disqus_thread”></div>
</div>
<script>
var disqus_config = function () {
this.page.url = ‘<?php echo get_permalink(); ?>’;
};
</script>
<noscript>Please enable JavaScript to view the <a href=”https://disqus.com/?ref_noscript”>comments powered by Disqus.</a></noscript>

Then please open the footer.php file and please keep the code below above the code</body>

<script>
(function() {
var d = document, s = d.createElement(‘script’);
s.src = ‘//username.disqus.com/embed.js’;
s.setAttribute(‘data-timestamp’, +new Date());
(d.head || d.body).appendChild(s);
})();
</script>

Please replace the code username with your blog’s Disqus username.

Add a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.