What did I do to make the indicators very good!
I changed the plugin code a bit as follows:
Open the plugin.php file and find:
Code: Select all
$code = <<<EOF
<!-- Disqus plugin -->
<div id="disqus_thread"></div>
<script>
var disqus_config = function () {
this.page.url = '$pageURL';
this.page.identifier = '$pageID';
};
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = 'https://$shortname.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<!-- /Disqus plugin -->
EOF;
return $code;
Code: Select all
$code = <<<EOF
<!-- Disqus plugin -->
<div id="disqus_thread"></div>
<script>
var disqus_config = function () {
this.page.url = '$pageURL';
this.page.identifier = '$pageID';
};
var disqus_observer = new IntersectionObserver(function(entries) {
// comments section reached
// start loading Disqus now
if(entries[0].isIntersecting) {
(function() {
var d = document, s = d.createElement('script');
s.src = 'https://$shortname.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
// once executed, stop observing
disqus_observer.disconnect();
}
}, { threshold: [0] });
disqus_observer.observe(document.querySelector("#disqus_thread"));
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<!-- /Disqus plugin -->
EOF;
return $code;
I hope I was helpful!