Archived topic
Template Tag for dynamic image in element
3 replies · Started by Benny on January 14, 2021
Hi team,
Thank you for this amazing piece of software (goes for both GP and WP Show Post).
I never thought I could be happier after giving away my money :)
Case: I've created a custom field ("thq_featured_icon") and assigned it a value of a string ("https://mydomain/folder_1/subfolder/sub-subfolder/imageName.svg"). Including the "".
Everything works fine when I use:
<img src="https://mydomain/folder_1/subfolder/sub-subfolder/imageName.svg" alt="featured icon" width="200" height="400">
But it doesn't work when I switch to:
<img src={{thq_featured_icon}}
I guess I have to mask those "" in some way, but I can figure out how.
Thanks
Hi there,
to get a custom field in the Header element you use this tag: {{custom_field.name}}
So yours would be: {{custom_field.thq_featured_icon}}
Not sure if that will work in this context - let me know :)
David, you are my hero!
Thanks very much.
It works :)
Glad to be of help