WordPress custom image size on custom field image

Hi can anyone tell me a good way to use a custom image size with a custom field image in a template without using something like timthumb/phpthumb.

I’ve set an image size with…

add_action( 'after_setup_theme', 'theme_setup' );
function theme_setup() {
add_image_size( 'theme-custom-size', 329, 118, true );
}

which is fine for the featured image, I just call

the_post_thumbnail( 'theme-custom-size' );

but could I apply this size to an image grabbed with get_post_meta from a custom field image.

Thanks!

EDIT:_

ok, I think a simple way to do it would be to use this plugin http://wordpress.org/extend/plugins/multiple-post-thumbnails/
and use multiple featured images rather than custom fields.

1 Answer
1

when you get image form post_meta, you get the path to the image, then you get do something like :

<img src="https://wordpress.stackexchange.com/questions/21718/<?php echo get_post_meta(ID,"customr field name',true); ?>" 
        width=200 height=200 />

Leave a Comment