Display categories which only contain entries I'm grabbing a list of categories and displaying their entry count.
How can I only display categories which have entires? So I'm not getting any with 0 in them, which is occurring as I have a few entries not yet published with new categories.

{% nav category in craft.categories.group('insights') %}
{# Get the count of entries related to `category` #}
{% set entryCount = craft.entries.relatedTo(category).total() %}
    &lt;li&gt;
        &lt;a href="{{ category.url }}"&gt;{{ category.title }} ({{ entryCount }})&lt;/a&gt;
    &lt;/li&gt;
{% endnav %}
A simple but effective solution would be to just wrap the output in a conditional.

{% if entryCount %}
    &lt;li&gt;...&lt;/li&gt;
{% endif %}