I would be grateful to get help with this code.
I am trying to load medium-sized images from an array of images stored on each ‘artist_work’. Each word can have multiple images, but I am just grabbing the first one.
My current code to get the URL of the image is:
$images = get_field('images', $artist_works->ID); $size = 'medium'; // (thumbnail, medium, large, full or custom size) $image=$images(0); wp_get_attachment_url( $image('ID'), $size );
This works, however it will not load the medium image, and only return the full URL of the fullsize image.
I have this code to try, but it does not work:
wp_get_attachment_image_src( $artist_works->ID, 'medium')(0);
Would be stoked if anyone can help. Thank you!!!!!