I have a category page that lists all of the entries related to that category. And then I want to display the selected child category for the entry... in brief like so:
Entry Title 1
Entry 1's Child-Category
Entry Title 2
Entry 2's Child-Category
Entry Title 3
Entry 3's Child-Category
My category field handle is chooseLocation
Here is what I have in my template: (snippet taken from here)
{% for entry in entries %}
{% if entry.chooseLocation | length %}
{% for category in entry.chooseLocation %}
<a href="/location/{{ category.slug }}">{{ category }}</a>
{% if not loop.last %}, {% endif %}
{% endfor %}
{% endif %}
{% endfor %}
The problem is, this get's the parent category (which is the category page we're on) but not the child category. I need to show just the child category and not the parent.
I've looked through the docs but I can't find anything on how to do this.