Disqus comment count is wrong #427

flexthink opened this Issue Oct 8, 2012 · 2 comments


None yet

2 participants


With Disqus enabled, the comment count at the top of a blog post page shows zero comments even if there have been comments posted.

The comment count on the listing page is correct though

I was able to fix this one myself with a template customization. It would be nice to see it work out of the box though.

in blog_post_details.html:

Replace the comment count with:

    {% if blog_post.allow_comments %}
        {% if settings.COMMENTS_DISQUS_SHORTNAME %}
        <a href="{{ blog_post.get_absolute_url }}#disqus_thread"
            data-disqus-identifier="{% disqus_id_for blog_post %}">
            {% trans "Comments" %}
        {% else %}      
            (<a href="#comments">{% spaceless %}
            {% blocktrans count blog_post.comments_count as comments_count %}1 comment{% plural %}{{ comments_count }} comments{% endblocktrans %}
            {% endspaceless %}</a>)
        {% endif %}
    {% endif %}

Also, add this at the bottom:

{% include "generic/includes/disqus_counts.html" %}
{% endif %}

Thanks for working this out. Could you set up a pull request? Would be happy to merge it in.

@stephenmcd stephenmcd pushed a commit that closed this issue Oct 11, 2012
cato Fixes #427: Disqus comment counts are now pulled in on the blog post …
…detail page, if available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment