Home › Forums › Add-ons › Repeater Field › Getting Alt Text to show up in Image Field › Reply To: Getting Alt Text to show up in Image Field
change the return value to image array (or object) then change every instance in the original code is getting the image field so that the values are not formatted
example change get_sub_field('image')
to get_sub_field('image', false)
this will preserve the all of the original code with the minimum amount of alteration and allow you to use the full image array.
Then to add your additional code you can get the field again in the original way.
Either that or use
$alt = get_post_meta(get_sub_field(image), '_wp_attachment_image_alt', true);
to get the alt text for the image
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.