Using wordpress get_post_meta $key. I was able to output attachment image in single.php using Function Reference/wp get attachment image src for single attachment id:
<?php
$attachment_id = get_post_meta($post->ID, 'attachment-id', true); // attachment ID
$image_attributes = wp_get_attachment_image_src( $attachment_id ); // returns an array
if( $image_attributes ) {
?>
<img src="<?php echo $image_attributes[0]; ?>" width="<?php echo $image_attributes[1]; ?>" height="<?php echo $image_attributes[2]; ?>">
<?php } ?>
Since I am coding image gallery, I intend to use php foreach function to html output multiple images html code replacing the single post_meta $key with multiple ids array like (55,32,34). I need help with the code required to restructure the output due to my lack of PHP knowledge.