I am using Types plugin in WordPress to create custom post type.
I have added custom filed “Image field” which is repeating field and in this way I want to create something like gallery in my post type
here is how I call the images in the front end
$images = get_post_meta(get_the_ID(), 'wpcf-application-image');
foreach ($images as $image) {
echo '<a rel="attachment" href="' . $image . '"><img src="' . $image . '" /></a>';
}
With that code I see the list with all images and link to the media file.
But how can I add a thumbnail instead of the exact image in the img tag?
Thank you!
If you only have the image url (not the id) then you can use a function like this to return the url (add it to functions.php etc):
Then you can use that ID to display the thumbnail:
Hi Simon and thank you for your help!
I added the code you posted but the images doesn’t show up and I had
but you showed the the right way I and modified my code and now its work!
here is what I have:
Thanks again!