When we simply want to show an image defined by a custom field (say “feature-image”) we’d use:
<img src="<?php echo get_post_meta($post->ID, 'feature-image', true); ?>" />
And now lets consider that due to my media settings, two more sizes of the same image above are created — 310×150 and 150×75 pixels each. How do I call them? (I mean, code for each image — I want to call each image size separately.) Is there a code similar to above that could use?
PS: I’ve noticed that questions requiring some code are being asked here on SO, and not WP.SE (at least not always). So, I thought it would be better to ask mine here as well.
If you know the image sizes you want, then you can use
You will of course have to find the attachment id to call wp_get_attachment_image.
http://codex.wordpress.org/Function_Reference/wp_get_attachment_image