Home › Forums › General Issues › How to use ALT tags › Reply To: How to use ALT tags
Nevermind found a fix myself 🙂
I think the main reason was related to the fact that the “return format” was set to “Image URL” instead of “Image Array”.
After I changed that in my WordPress backend I now use the following code in my template and it gives me the alt tag and title tag of the image:
<?php
$image = get_sub_field('inside_the_customer_imgs');
printf( '<img src="%s" alt="%s" title="%s" />', $image['url'], $image['alt'], $image['title'] );
?>
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.