I need to output a list of channel authors. There are about 40 authors but I want the 8 authors with the most entries. Not sure how to achieve this.
What I have so far:
{# get all the itbuzz entries #}
{% set allEntries = craft.entries.section('itbuzz').all() %}
{# get all the authors #}
{% set authors = craft.users.group('itBuzzAuthor').limit(8).all() %}
<ul class="flex flex-row flex-wrap">
{% for author in authors %}
<li class="inline-block mb-4 mr-4 text-sm text-center">
<img src="{{ craft.gravatar.url( author.email ) }}" alt="">
<a href="#" class="text-blackBrand">{{ author.firstName }}<br>{{ author.lastName }}</a>
</li>
{% endfor %}
</ul>
All this does is output the first 8 authors, it's not finding the 8 with the most entries.