{{ category.title }} error with category groups I feel like I'm missing something totally obvious here, but how do I output a category name for a category that is part of a category group on a single entry layout? The name of the category group is 'Archive' and the slug 'archive'.

Here is what I'm trying to do.

&lt;a href="*dynamic url to category index*"&gt;*name of category*&lt;/a&gt;

Here is what I tried 

&lt;a href="{{ category.url }}"&gt;{{ category.title }}&lt;/a&gt;

However then I get the error "Variable "category" does not exist."

Trying the following code snippet from the official tutorial also did not work.

    {% for category in entry.postCategories.all() %}
      &lt;a href="{{ category.url }}"&gt;
        {{- category.title -}}
      &lt;/a&gt;
    {% endfor %}
  {% endif %}


resulting in the following error: "Calling unknown method: craft\elements\Entry::postCategories()"

Any help to solve this probably very simple problem is appreciated. Thank you!
You should replace postCategories with whatever the handle of the category field is for your entry.