How to add comments to Squarespace Courses using Disqus

Replace YOURSHORTNAME in the code below with your disqus shortname and add the page header code injection for your course.

<script>
document.addEventListener("DOMContentLoaded", function() {
    // Define the Disqus configuration
    var disqus_config = function () {
        this.page.url = window.location.href;  
        this.page.identifier = window.location.pathname;
    };

    // Function to add Disqus to the page
    function addDisqus() {
        // Create the Disqus div
        var disqusDiv = document.createElement('div');
        disqusDiv.id = 'disqus_thread';

        // Find the last article element on the page
        var articles = document.querySelectorAll('article');
        var lastArticle = articles[articles.length - 1];

        // Insert the Disqus div after the last article
        if (lastArticle) {
            lastArticle.parentNode.insertBefore(disqusDiv, lastArticle.nextSibling);
        }

        // Disqus embed script
        var d = document, s = d.createElement('script');
        s.src = 'https://YOURSHORTNAME.disqus.com/embed.js';
        s.setAttribute('data-timestamp', +new Date());
        (d.head || d.body).appendChild(s);
    }

    // Add Disqus to the page
    addDisqus();
});
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>

Where to find your disqus shortname

Settings > General

Omari Harebin

Omari Harebin started sqspthemes over a decade ago as a live case study on building a business around Squarespace. He’s since helped dozens of plugin developers and designers generate millions of dollars in combined revenue across the ecosystem. He also runs Bigger Budget Projects, which helps web consultants and small agency owners find and win higher-value website contracts.

https://www.omariharebin.com
Previous
Previous

How can I build confidence in my decision to leave?

Next
Next

How to customize your Squarespace course labels