Archived topic
How to display category link on page hero?
5 replies · Started by Kemo on October 27, 2019
hi!
I'd like to display a category link on a page hero, I tried this:
<h1 class="header">
{{post_title}}
</h1>
{{post_author}} | {{post_date}} | {{post_category}}
But apparently post_category doesn't work like that. Is there a list of these variables that work on post hero?
I don't have a website to show as I'm working on a staging server.
thanks
Hi there,
you use the {{post_terms.taxonomy}} template tag so to display category you would add:
{{post_terms.category}}
thank you! is there a list of these somewhere?
In the header element there is a small meta box displaying the top level ones. And this doc explains more:
https://docs.generatepress.com/article/header-element-template-tags/
again, thank you David
You're welcome