Home › Forums › General Issues › get image alt in flexible field › Reply To: get image alt in flexible field
Hi Kenneth,
It depends how the Image field is setup. I prefer to have the image setup as the Image Object. You can select this when you create the field; return value.
Then it is as simple as:
$img = get_field('field_name'); // or use get_sub_field('field_name')
echo $img['alt'];
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.