Home › Forums › ACF PRO › Image field returns a string instead of an array › Reply To: Image field returns a string instead of an array

I know these may sound like an obvious questions, but the code you have for displaying the images appears that it should be working.
Is code is in “The Loop” of the search results page?
Check to be sure that there is actually an attachment post with the post ID of 302 and that it is an image. This could cause the ID to be returned instead of the image array.
Also, rather then if( !empty($image) ): you could do if (is_array($image)): This would be a better test.
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.