Filter for post_thumbnail: link to small src and add data-attribute [duplicate]
Since you already know your $post_image_id, you can use wp_get_attachment_src() $small = wp_get_attachment_src($post_image_id, ‘smallest-size’); $large = wp_get_attachment_src($post_image_id, ‘full’); $smallURL = $small[0]; $largeURL = $large[0]; where ‘smallest-size’ is the name of the image-size you have predefined in add_image_size()