Home › Forums › General Issues › responsive images with ‘image array’ return format › Reply To: responsive images with ‘image array’ return format
I only included the construction of the image tag and not how the values are derived.
ACF image field would be set to return the ID, then with the ID you would use wp_get_attachment_image_src() using the ID and the $image_size you want as the maximum size. This gives you the url, width and height.
You would use other WP functions to some other method to get the alt and title values if you want to use them.
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.