Home › Forums › General Issues › Querying a subfield to retrieve an image › Reply To: Querying a subfield to retrieve an image
I really appreciate you taking the time to help.
Posted this on Stackoverflow and got an answer (even though somebody else deleted the right answer before I could thank them).
For anybody else who comes across this, I need to convert it this way.
$image_id = get_post_meta( $row->post_id, $meta_key, true );
//$image_ids = unserialize($image_id);
$json = json_decode($image_id);
// load image src
// - https://www.advancedcustomfields.com/resources/field-types/image/
$src = wp_get_attachment_image_src( $json->cropped_image, 'cropped_image' );
It was a JSON object which needed to be decoded.
Thanks again for helping – means a lot to somebody who was completely stuck.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.