The get_post_meta()
function can help to get the meta field but will not retrieve different size.
Assuming _pf_photo1
embed the attachment id, you can do something like that:
// Note the "_id" suffix
$attachment_id = get_post_meta($post->ID, '_pf_photo1_id', true);
Last parameter for this function can not be 'medium',
Now,you can use $attachment_id
with different function depending on what you really want to get (url, img element...):
$attachment_element = wp_get_attachment_image( $attachment_id, 'medium' );
echo $attachment_element;
There is more ways to get details for attachment wp_get_attachment_url()
, wp_get_attachment_image_src
(that returns an array with url, width, height).
You will find more details to discover these functions here
Hope it helps !