I am using a custom field to upload an image to my post. I now want to display this image on the post by editing the template but struggling to find out how.
My custom field is called ‘image’ but all I can seem to do is display the URL of the image when I echo it.
Is there a simple way / line of code to display this image on the post?
Thanks
I used this code to get the image
<?php echo get_post_meta($post->ID, 'image', true) ?>
obviously it is not the best and only gets the field value.
If you’re just displaying it via html you can simple do this if
<?php echo get_post_meta($post->ID, 'image', true) ?>returns a URL for the image.this will use the URL you have returned to get the image.