I'm trying to group entries by user on my front-end. I've got so far but I can't seem to get any further to my goal of displaying what type of entries they have posted e.g. lifestyle or tech.
to do this I need to get the users entries
and query a service
dropdown field, if they have lifestyle
selected in multiple entries only display 1x tag showing the user has lifestyle
posts.
So far I'm just trying to query each user's entries.
{% set listings = craft.entries.section('listings') %}
{% set users = craft.users.group('influencer').all() %}
{% for user in users %}
{% if user.getPhoto() %}
<img class="img-fluid rounded-circle" src="{{ user.getPhoto().getUrl('thumbnail') }}">
{% else %}
<img class="img-fluid rounded-circle" src="{{ url('images/user-ph.png') }}">
{% endif %}
<h5 class="card-title">{{ user.username }}</h5>
<small>{{ user.location }}</small>
<p class="card-text">{{ user.richText }}</p>
{% for user, entries in craft.entries.find() | group('users') %}
{% for entry in entries %}
{{ entry.title }}
{% endfor %}
{% endfor %}
{% endfor %}