如何在wordpress的自定义帖子模板上循环自定义字段?

I'm making two different index page post layouts via custom fields but want them both to appear the same once you click through. The problem is that even with on posts with the same index page layout, a section of it only appears on the latest post using the custom field.

So here's the code -

in index.php, as part of the loop I have

<img src="<?php echo get_post_meta($post->ID, 'img_post_leftcol', true);?>" width="25%" height="200" /> 

<img src="<?php echo get_post_meta($post->ID, 'img_post_header', true);?>" width="100%" height="500" />

and I use img_post_header/leftcol as my custom fields so far.

What this does is make a designated image appear at the top of the post I apply it to, above the post title etc. The problem arises when I click through to the post page, where only the latest post will still have the image above the title etc while the rest dont show the image at all.

What I tried, unsuccessfully was to put the following above the code for the post header, into my custom post template -

<?php if (get_post_meta($post->ID, 'img_post_header')): ?>

<div><img src="<?php echo get_post_meta($post->ID, 'img_post_header', true);?>" width="100%" height="500" /></div>

<?php endif; ?>

This is as far as I've reached, any help would be appreciated.

[EDIT] GOT IT TO WORK, it was actually some bad code i forgot to remove from an earlier at attempt at getting this done in index.php, and I'm also simply using the following for the post template currently

<img src="<?php echo get_post_meta($post->ID, 'img_post_header', true);?>" width="100%" height="500" />