Iklan

Disqus Comment Becomes Untitled After Switching To HTTPS, Here's The Solution

Disqus Comment Becomes Untitled After Switching To HTTPS, Here's The Solution


What I mean Disqus comments to be untitled is like the picture above. That is a notification that goes into email if anyone commented on the post. With Untitled then all email notifications from all posts become one.

It happens after the blog switches to HTTPS and occurs in published posts after switching to HTTPS. It should be there post title, so the notification of comments from each post not mixed into one.

Previously I did not think this, I thought maybe this is because the new switch to HTTPS and Disqus has not detected the blog URL changes. But after I read, Disqus will automatically detect the new URL.

But after publishing some new post after switching to HTTPS, Untitled Notifications still occur. Though the Disqus code has nothing changed and before switching to HTTPS does not happen Untitled notifications like this.

Finally I found the solution, if something like this happens, we need to tell Disqus for the post title with this.page.title code.

1. Blog AMP HTML
If you are using a blog with AMP HTML and Disqus comments become Untitled after switching to HTTPS, please replace your blog Disqus comment code with the code below.

<amp-iframe expr:src='&quot;https://cdn.rawgit.com/KompiAjaib/kompi-html/master/ampdisqus_blogger4.html?shortname=Your-Disqus-ID&amp;fontBodyFamily=sans-serif&amp;fontLinkColor=e8554e&amp;canonicalurl=&quot; + data:blog.canonicalUrl + &quot;&amp;title=&quot; + data:blog.pageName' frameborder='0' height='300' layout='responsive' resizable='resizable' sandbox='allow-forms allow-scripts allow-same-origin allow-modals allow-popups' width='600'>

<div aria-label='Disqus Comments' overflow='' role='button' tabindex='0'/>

</amp-iframe>

Please replace your-disquaID with your blog Disqus shortname, adjust sans-serif with your blog typeface, and e8554e please adjust to the color of your blog link.

2. Blog Non AMP HTML
If you use the Non AMP HTML blog and Disqus comments become Untitled after switching to HTTPS, please replace your blog Disqus comment code with the code below.



<div id="disqus_thread"></div>

<script>

    /**

     *  RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.

     *  LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables

     */

    var disqus_shortname = &quot;shortname&quot;;

    var disqus_config = function () {

        this.page.url = &quot;<data:blog.canonicalUrl/>&quot;;

        this.page.identifier = &quot;&quot;;

        this.page.title = &quot;<data:blog.pageName/>&quot;;

    };

 

    (function() {  // REQUIRED CONFIGURATION VARIABLE: EDIT THE SHORTNAME BELOW

        var d = document, s = d.createElement(&quot;script&quot;);

        s.src = &quot;//&quot;+disqus_shortname+&quot;.disqus.com/embed.js&quot;;  // IMPORTANT: Replace EXAMPLE with your forum shortname!

        s.setAttribute(&quot;data-timestamp&quot;, +new Date());

        (d.head || d.body).appendChild(s);

    })();

</script>

Please replace shortname with your blog Disqus shortname.

The changes will be visible in the new post published after replacing the Disqus comment code. Disqus email notification will return to the post title.

Disqus Comment Becomes Untitled After Switching To HTTPS, Here's The Solution


Hope this helps.

Next
Prev Post
Previous
Next Post
Buka Komentar