I have managed to work it out – the function was leading to a lot of queries, so I rewrote it as follows:
$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="" />';
}
Related Posts:
- Custom Taxonomy Images with Advanced Custom Fields
- Advanced custom fields – taxonomy terms images [closed]
- How to add images to taxonomies?
- Adding Category/Tag/Taxonomy Support to Images/Media
- Order get_terms using a Custom Field
- Get value in custom field with taxonomy [closed]
- Remove Category description textarea
- Displaying ACF image field [closed]
- Correct Way To Show Custom Taxonomy for Image Attachments on Template File
- Display an image instead of tag name?
- Operations with custom fields values in a loop
- ACF vs Taxonomies
- Specifying a size when displaying an image associated with a taxonomy through ACF
- How to display custom taxonomy images on index.php?
- Meta query for a custom taxonomy on attachment
- How to add contents of a custom field to a taxonomy term list?
- Taxonomies image
- Search Tool only refreshes Page without showing results
- Display value of custom field of custom taxonomy in single post?
- How to fetch the data from Advanced Custom post when we search specific keyword or field name related to the post?
- WordPress implode & wp_insert_post question
- Display a colour of custom taxonomy on the page
- Can’t get taxonomy ID for each post on archive page
- Loop to display ONLY custom taxonomy parent information [closed]
- Using Advanced Custom Fields Relationship Field to select a taxonomy term
- Replace taxonomy term with an image in a custom loop
- query to use to link to taxonomy single page
- Featured Images for Tags?
- Show related posts on single.php, grouped by taxonomy terms, with Advanced Custom Field post object selected
- How can I get Taxonomy Images to work with ‘orderby’ argument?
- Why do my quick edits for custom taxonomies not show on the post frontend?
- Echo ACF taxonomy field within a foreach for another taxonomy
- new custom filed not showing in taxonomy
- Connect ACF field + custom taxonomy [closed]
- Adding Advanced Custom Fields to posts
- Query all images with certain tag in media library using visual portfolio plugin
- ACF Field, hide taxonomy title and image when no nothing selected in post
- ACF Custom field not showing in Timber Taxonomy page
- WordPress search form and search result through ACF field in custom taxonomy
- How to show selected check box vendors on front end home page?
- Resize $term attachment using url
- Creating a list with multiple categoreis and options
- Add image to taxonomy and output to homepage
- Taxonomies, Adanced Custom Fields and Repeatable Fields
- Get taxonomy image for Toolset custom taxonomy through Toolset Views Shortcode
- ACF Display Taxonomy Image Field
- Display posts from specific slug of the custom taxonomy in WordPress
- Gravity Forms with Advanced Post Creation Add-On not updating ACF fields on custom taxonomy
- ACF – How to get custom taxonomy term image field
- Show Hide Post Information based on term clicked by user
- WP get_terms and ACF field
- Taxonomy archive template that shows posts from more than one taxonomy
- check if a taxnomy queried in $wp_query?
- Taxonomy page shows category in title
- W3 total cache – white screen of death when trying to show certain taxonomies [closed]
- How to get this value inside RETURN
- How to list Custom Taxonomy
- Hide echo of no categories from get_object_taxonomies
- How to add a date creation field when a custom taxonomy relationship is created?
- Taxonomy.php how to show post only in current taxonomy with wp_query?
- Comma separator problem of custom taxonomy
- How can i fix a 404 error when targeting custom taxonomy slug ?
- List custom taxonomies associated to an author’s posts
- Need to display custom taxonomy on single page – not working
- remove term from custom taxonomy list
- Display taxonomy with a maximum number of letters
- Why can’t I access Custom Taxonomy metadata?
- Current taxonomy name (not term!) given a post ID
- Permalinks with custom taxonomies and regular categories
- WP_Query tax_query – Show results if child has parent X
- WooCommerce custom taxonomy as meta?
- Custom Taxonomy List with Children
- Don’t display taxonomy if empty
- how to access the $query variable inside taxonomy-xxx.php template file?
- Query custom taxonomy for category including children
- List terms of custom taxonomy if matches other taxonomy
- Adding Child Terms Programatically – No Warning but No dice either
- Is there a way to change select-list for new custom taxonomy?
- Order custom taxonomy by date
- Permalink issues with custom taxonomies
- Fix Custom Taxonomy Display two times on each call
- Displaying Posts Attached to Custom Taxonomy Terms
- SQL / wp_update_post: change post custom field to CPT post taxonomy
- Update Post Taxonomy Automatically Based On Date
- Update Custom Taxonomy Value for a post based on custom date field
- Taxonomy Overview Page?
- Custom taxonomy display name issue
- Proper way to create taxonomy queries
- how to use tax_query to apply both terms or one if one is empty
- How to avoid foreach error WebDevStudio’s WDS_Taxonomy_Radio taxonomy metabox class?
- Variable Not Working Inside is_author() Array
- How to output taxonomy term (incl. link to archive) on author.php?
- Custom taxonomy page not working
- Get current page term title to use in WP_Query
- Taxonomize taxonomy terms?
- why the archive of custom taxonomy term shows nothing?
- passing moree than one value of slugs in taxonomy using variable
- Show all terms in a custom taxonomy with all child terms wrapped in a ul
- Order taxonomy terms wordpress
- Show single Child Category on Custom Post