You can use the function [wp_calculate_image_srcset()][1], a helper function to return the srcset attribute value for an image ID, the different sizes need to exist, otherwise the function return false. Here is what a link with srcset look like, <img class=”alignnone size-full wp-image-122491 ” src=”http://example.com/wp-content/uploads/2016/03/C0101-012.jpg” alt=”C0101-012″ width=”2000″ height=”1200″ srcset=”http://example.com/wp-content/uploads/2016/03/C0101-012.jpg 2000w, http://example.com/wp-content/uploads/2016/03/C0101-012-656×394.jpg 656w, http://example.com/wp-content/uploads/2016/03/C0101-012-1024×614.jpg 1024w, http://example.com/wp-content/uploads/2016/03/C0101-012-1080×648.jpg … Read more