You can get the ID for the attachment with $attachment_id = get_field('field_name');
. When you have the ID you can use wp_get_attachment_metadata()
to get the info associated with the image in an array. The images width and height are stored in cells named width
and height
.
$attachment_id = get_field('field_name');
$metadata = wp_get_attachment_metadata($attachment_id);
$width = $metadata['width'];
$height = $metadata['height'];