2015-01-17, 20:29:50
disqus comments for News Manager (3.0+)
- In News Manager's settings, enable Custom settings and enter this:
or
if you prefer to have comments displayed inside the post's <div> container.
(I'm using nm-comments but you can use whatever name you want)
- Enter your disqus.com account and add a new site to your profile (if you hadn't already done)
(Optionally, choose Universal Code as your platform and copy the code in step 1 to your clipboard or a text file - but see above for a custom code.)
- In your GS site admin -> theme -> components, create a component nm-comments.
In this component you can paste the Universal Code. But you could paste this one instead, changing the $my_disqus_shortname and $my_disqus_id_prexix variables to customize it for your site:
- In News Manager's settings, enable Custom settings and enter this:
Code:
single componentafterpost nm-comments
Code:
single componentbottompost nm-comments
(I'm using nm-comments but you can use whatever name you want)
- Enter your disqus.com account and add a new site to your profile (if you hadn't already done)
(Optionally, choose Universal Code as your platform and copy the code in step 1 to your clipboard or a text file - but see above for a custom code.)
- In your GS site admin -> theme -> components, create a component nm-comments.
In this component you can paste the Universal Code. But you could paste this one instead, changing the $my_disqus_shortname and $my_disqus_id_prexix variables to customize it for your site:
Code:
<?php
// edit these 2 lines:
$my_disqus_shortname = "example"; // Required - Replace example with your site's disqus shortname
$my_disqus_id_prexix = "blog/"; // You can leave it empty ("") if you won't have comments in other GS pages, etc.
?>
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: THIS CODE IS ONLY AN EXAMPLE * * */
var disqus_shortname = '<?php echo $my_disqus_shortname; ?>';
var disqus_identifier = '<?php echo $my_disqus_id_prexix; nm_post_slug(); ?>';
var disqus_title = '<?php nm_post_title(); ?>';
var disqus_url = '<?php nm_post_url(); ?>';
/* * * 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="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>