Page Header Template Tags

Page Headers have a list of dynamic template tags which you can add to your content.

These tags will pick up elements based on the page you’re currently viewing.

{{post_title}}

Will pick up the title of the page or post you’re currently viewing. It will also pick up the current taxonomy title if the Page Header is applied to a taxonomy (category, tag etc..).

{{post_date}}

Will print the published date of the post you’re currently viewing.

{{post_author}}

Will print the author of the post you’re currently viewing.

{{post_terms.taxonomy}}

This template tag will list the associated terms of the post you’re viewing. For example, if you want to display the categories the current post is added to, you would do this:

{{post_terms.category}}

If you wanted to display the product categories, you would do this:

{{post_terms.product_cat}}

For tags, you would do this:

{{post_terms.post_tag}}

As you can see, this template tag can be used to display terms from any taxonomy you want.

{{custom_field.name}}

This template tag allows you to display custom fields from the currently viewed post. This is one of the most powerful template tags, as it can be used to display nearly anything you like.

So we if we add a custom field and name it something like description, and give it a value:

We can then print this custom field inside our Page Header like this:

{{custom_field.description}}

If you want to print your featured image in your Page Header, you can do this:

{{custom_field._thumbnail_id}}

This will generate the full HTML for your featured image.