How to Enable WordPress Custom Fields in Wordpress post
How to Display Content using WordPress Custom Fields
How to Call WordPress Custom Fields in Posts
get_post_meta //To fetch values from custom fields $post->ID //To get a post's ID within the $post variable key // Represents the name of the custom field
Add the following code to your html structure wherever you want to output the metadata info which in this case is the post image.
<?php echo get_post_meta($post->ID, 'key', true); ?> <?php echo get_post_meta($post->ID, 'post-images', true); ?>// In Our example
Here first argument '$post->ID' is pulling post's ID within the $post variable, the second argument 'key' represents the name of the custom field which must be replaced by the name of your custom field and the third argument is saying if there is a custom field then display else remain empty.
Now I can render the image on the posts for which the image has been set by inserting the following code inside the single.php file of my theme:
// get_post_meta accepts three parameters ('POST ID', 'CUSTOM FIELD KEY', 'TRUE OR FALSE')