I’ve a query in regards to the WordPress perform image_get_intermediate_size
. It appears to at all times return false for me. I’ve confirmed the picture exists at totally different dimension – utilizing get_attachment_image_src
. The explanation I am unable to use that perform on this specific case, is that the picture is definitely larger on smaller screens.
$featured_image = get_field('square_image', $featured); // get picture url
$featured_image_id = attachment_url_to_postid($featured_image); // convert url to id
$featured_image_small= image_get_intermediate_size($featured_image_id); // picture thumbnail
var_dump($featured_image_small);exit();
Within the code above, $featured
is a put up ID. The put up has a number of photos related to it, one in every of which is square_image
, that shops a picture url. $featured_image_small
ought to technically retrieve the picture on the thumbnail dimension, however it solely returns false.