I know that when you upload an image to the Wordpress media library, it automatically creates some duplicates of that image in different sizes. I'd like to know how I can return those differently sized image files.
The solution I'm currently using is this:
<?php $image = get_field('image'); $imageurl = $image ['url']; ?> <img src="<?php echo str_replace(".jpg","-800x500.jpg",$imageurl); ?>">
This is fine, but I'm looking for a function native to wordpress that would do this. Like querying an array of these differently sized files of the same image.
Note that wp_get_attachment_image_src and functions like it are not what I'm looking for. Even though you can set a size to be returned, it doesn't change the file in question.