Archived topic
Template Tags in Elements not showing up
22 replies · Started by Aldrin on January 21, 2020
Hi, I have setup an element and asigned it to the right area to show. Within the element I used Template Tags...Issue I'm having is {{post_title}} shows up correctly...for example "Example Title", but anything like {{post_author}} or {{post_terms.taxonomy}} etc shows up exactly as {{post.whatever}} in brackets. Can someone shed some light if there is there is some specific settings to display other tags correctly?
Hi there,
Any chance you can link us to the site in question?
You can edit the original topic and use the private URL field.
Let me know :)
Hi Leo, I'm actually running the site locally. I think I might be trying to achieve something which might not be supported with this feature. The element I have created is set to show on woocommerce product category archive pages. For example /product/cars/bmw/ ... I wanted to have the word BMW show on the products under/product/cars/bmw/ category archive page. Hope I am being clear enough.
Hi there,
{{post_author}} should work on any single post displaying the byline.
To display the post categories you would use: {{post_terms.category}}
Hi David, thank you but I already mentioned that I did try {{post_terms.category}} in the archive sections and it still shows up exactly as {{post_terms.category}}. So, I created an Element, next I added {{post_terms.category}}, then in Display Rules > Location I specified Product Category Archive -> All Product Categories. No luck
Sorry missed the woocommerce part - so you need this:
{{post_terms.product_cat}}
Thanks again David...I did try that before {{post_terms.product_cat}}...still no luck

Hmm, it's not trying to render at all.
Does this work on a regular post using {{post_terms.category}}?
If not, can you try deactivating your other plugins to rule out a conflict?
Hi Tom, sorry for the delay. I even tried installing a fresh WPress and theme files and GP Prem plugin. Out of laziness I did import the demo content. I still see the bracketed values instead of the correct values. None of them work, except for {{post_title}}
Can you share the exact HTML you have in the Header Element ?
When adding code to the forum, please highlight and hit the Code button before submitting
Hi David, here you go. {{post_title}} Testing {{post_terms.category}} or {{post_terms.product_cat}}
Tricky to diagnose the problem without seeing the site.
Any chance it can be pushed to a hosted environment ?
Sure David...How would I forward you the credentials to the site?
You can send the dashboard access using Account Issue here:
https://generatepress.com/contact/
Please include the following information:
– The URL of this topic.
– Login URL.
– Username and password.
Oops we may have missed the obvious in this topic:
{{post_terms.taxonomy}} eg, {{post_terms.product_cat}} cannot be used on Archives. As that would be the same as the {{post_title}}
If you change your display rules to the Product > All Products then you will see the Title and the Terms displayed on all products.