Archived topic
Using Template Meta Tags and Featured Image in Block Element - Hook
3 replies · Started by Oriol on February 23, 2021
Hello,
I'm trying to create a header for blog posts, inside the content area. For that purpose, I want to create a block element with two grid elements, one containing the featured image justified to the left, and the other one containing the blog post title and some other meta tags.
The problem is that I'm not able to use the same template meta tags we commonly use in header elements, such us {{post_title}}, in other kind of elements. I also don't know how to insert a parameter with the featured image.
Another option would be to use a header element instead, but in such case I would need to use a parameter with the featured image, as we need it placed in a separate block from the title and the other meta tag elements, rather that placed in the background.
Thank you so much in advanced.
Hi there,
Block Elements don't at this moment have dynamic content... BUT we're about to release GPP 2.0 for alpha testing which does :) And has some great new features.
If you can't wait then use a header element and you can use this template tag to get the featured image:
{{custom_field.thumbnail_id}}
Hello,
I've added {{custom_field.thumbnail_id}} to the header, but there is no image displaying.
Should I add the thumbnail_id custom field to the post, and assign it with an id of the featured image to every post, or is a field that already exists?
You just need to make sure that the Post has a Featured Image assigned to it.