2 edited title
| link

srcset and custom field get_post_meta and wp_get_attachment_url

1
source | link

srcset and custom field get_post_meta

I would like to use the new wordpress 4.4 function srcset with an image which comes from a custom-field like this

  <img src="<?php $bigimg = get_post_meta($post->ID, 'bg_file', true); echo wp_get_attachment_url( $bigimg );?>" alt="">

How could I get the srcset function work with it?

wp_get_attachment_image_srcset( 380, 'medium' ); 

srcset is already activated for post_thumbnails in my functions.php.

Thank you!