title: Ghost 1.0 Disqus Comment Count Not Reflecting the Post Comments
body: <p>I recently updated my <b>Ghost</b> version from <b>0.11.11</b> to <b>1.12.0</b></p>
  
  <p>I also added a PAGE_IDENTIFIER as per the <a href="https://help.disqus.com/customer/portal/articles/472098-javascript-configuration-variables" rel="nofollow noreferrer">Disqus - JavaScript configuration variables</a> </p>
  
  <p>The comment count on the index page is not reflecting the post comments.</p>
  
  <p>This <a href="http://jitblog.net/" rel="nofollow noreferrer">link</a> displays the main page comment counts for each post, in particular the post for Firefox is <b>0 comments</b></p>
  
  <p>This <a href="http://jitblog.net/firefox-does-not-display-checkboxes-and-radio-buttons/" rel="nofollow noreferrer">link</a> displays the Firefox post with Disqus comment count of 4.</p>
  
  <p><b>The following is my current script for comments</b></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
    /* * * DON'T EDIT BELOW THIS LINE * * */
    (function () {
      var s = document.createElement('script');
      s.async = true;
      s.type = 'text/javascript';
      s.src = '//' + disqus.shortname + '.disqus.com/count.js';
      (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
    }());
  &lt;/script&gt;
  </code></pre>
  
  <p><b>I am using the following to create the comment count link</b></p>
  
  <pre><code>&lt;i class="fa fa-comment-o"&gt;&lt;/i&gt; &lt;a href="{{url absolute="true"}}#disqus_thread" data-disqus-identifier="{{comment_id}}"&gt;Comments&lt;/a&gt;
  </code></pre>
  
  <p><b>The post comment script is as follows</b></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
    var disqus_config = function () {
      this.page.url = '{{url absolute="true"}}';
      this.page.identifier = '{{comment_id}}';
      this.page.title = '{{title}}';
    };
  
    /* * * 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);
    })();
  &lt;/script&gt;
  </code></pre>
  
  <p><b>Questions</b></p>
  
  <p>I have recently updated the URL links using the mapper but will this pickup the new <code>page.identifier</code>?</p>
  
  <p>If not, what steps can I take to fix the comment count?</p>
  
  <p><strong>Investigation</strong></p>
  
  <p><strong>1.</strong> The <code>count.js</code> file is indeed loaded as the link text is being replaced after load.</p>
  
  <p><strong>2.</strong> I found that an object is created when the Disqus count script is loaded called DISQUSWIDGETS. The DISQUSWIDGETS.forum field is undefined.</p>
  
  <p><strong>3.</strong> jnowland on GitHub Gist has deconstructed the <a href="https://gist.github.com/jnowland/6759321" rel="nofollow noreferrer">count.js</a> file and it seems the DISQUSWIDGETS.forum has to be defined in order to set the correct details to retrieve the count.</p>