template:
[preview]
type = file
[preview background]
type = file
i upload two images in post. And metadata is numbers, not filepaths:
var_dump ( the_meta());
result:
preview: 65
preview background: 66
template:
[preview]
type = file
[preview background]
type = file
i upload two images in post. And metadata is numbers, not filepaths:
var_dump ( the_meta());
result:
preview: 65
preview background: 66
http://codex.wordpress.org/Function_Reference/wp_get_attachment_image_src
Should answer your question.
Since the link doesn't totally explain what you need to do in this case - you need to set the attachment_id to the name of your custom field and then use the code as it's written on that linked page.
eg.
<?php $featured_image = get_custom_field('Featured Image') ?>
<?php $attachment_id = $featured_image; // attachment ID
$image_attributes = wp_get_attachment_image_src( $attachment_id ); // returns an array ?>
<img src="<?php echo $image_attributes[0] //inserts the image?>" width="450" height="250" >
[Please post code snippets between backticks or use the code button.]
:)
This topic has been closed to new replies.