Category list not returning all related entries Here's my code:

{% for category in craft.categories.group('artistLocation') %}

    {% set entryCount = craft.entries.relatedTo(category).total() %}

    {% if entryCount %}
        &lt;li&gt;
            &lt;a href="{{ category.url }}"&gt;{{ category.title }} ({{ entryCount }})&lt;/a&gt;
        &lt;/li&gt;
    {% endif %}

{% endfor %}


For some reason, this is only returning the first six categories with entries associated.

https://www.dropbox.com/s/a2ut7j48acnq1g0/Screenshot%202016-05-06%2010.49.34.png?dl=0

Nothing in the error logs that are shedding any light on it for me.

Any ideas would be awesome!
How many categories do you have in that locations group? A criteria model returns the first 100 elements only by default, so any category falling behind that wouldn't be listed, no matter if there's related entries or not.

Add limit(null) to your craft.categories criteria model to make it return all categories.