Using Disqus with headless Wordpress setup?
Does anyone have any experience using Disqus with a headless WP setup? I am working on converting a standard WordPress blog to a headless front end, with the users using the standard WP back end in the normal way. The blog is currently managing comments with Disqus, which I would like to load on the new static front end.
I read the instructions for setting up the Universal Embed Code, and am pulling in the post id as the page.identifier. In my actual code I am using the correct short name. The request to Disqus in my Network tab looks correct, but comments don't seem to be loading. Curious if anyone else has solved this problem.
var disqus_config = function () {
this.page.url = document.querySelector('link[rel="canonical"]').href || window.location.href;
this.page.identifier = '{{postId}}';
};
(function() { // REQUIRED CONFIGURATION VARIABLE: EDIT THE SHORTNAME BELOW
var d = document, s = d.createElement('script');
// IMPORTANT: Replace EXAMPLE with your forum shortname!
s.src = 'https://example.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();