For displaying Disqus on your site, typically on individual article or post pages.
- In Tumblr, visit Settings > Your Site > Customize
- Select "Edit HTML".
- Copy and paste the following code anywhere between the
<head>and</head>tags:<meta name='text:Disqus Shortname' content='' /> - Copy and paste the following code immediately after
{/block:Posts}:{block:IfDisqusShortname} <div id="disqus_thread"></div> <script type="text/javascript"> /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */ var disqus_shortname = '<example>'; // Required - Replace example with your forum shortname /* * * DON'T EDIT BELOW THIS LINE * * */ (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); </script> <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> <a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a> {/block:IfDisqusShortname} - Update the disqus_shortname variable in the embed code provided. If you don't, Disqus won't work.
- Select "Update Preview" and then "Save"
- Select "Appearance"
- Enter your Disqus site shortname in the "Disqus Shortname" field
Comment count code
For displaying comment counts on your site's home page.
- In Tumblr, visit Settings > Your Site > Customize
- Select "Edit HTML".
- Copy and paste the following code immediately before
{/block:Posts}:
{block:IndexPage}<a class="dsq-comment-count" href="{Permalink}#disqus_thread">Comments</a>
<script type="text/javascript">
var disqus_shortname = '{text:Disqus Shortname}';
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = '//' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
{/block:IndexPage}
