I'm currently using get_field with Advanced Custom Fields plugin (see here) to get a single image for search results. The end result is that these pages are loading slow, as I believe this is due to MySQL returning the whole array of all images in the gallery for the specified page, which ends up being huge.
To load the image, I am currently doing the following:
$image = get_field('house_photos');
if ($image) {
echo '<img src="' . $image[0]['sizes']['house_search'] . '" />';
}
Is there a more efficient way just to get this single image without requesting the entire array?
wp_get_attachment_image_src, so it may be something to consider (the image object is doing/returning more than you may need). – Zach Oct 9 '12 at 14:14