我已经设法解决了这个问题-该函数导致了大量查询,因此我将其重写如下:
$housePhotos = get_post_custom_values(\'house_photos\');
$housePhotos = explode(\';\',$housePhotos[0]);
preg_match_all(\'`"([^"]*)"`\', $housePhotos[1], $results);
$imageURL = wp_get_attachment_image_src( $results[1][0], \'house_search\' );
if (!empty($results[1][0])) {
echo \'<img src="\' . $imageURL[0] .\'" alt="" />\';
}