Home › Forums › General Issues › image Alt Text Issue › Reply To: image Alt Text Issue
You should not change any field but your image field.
Inside your ACF setup, you would have a field called post_slider_images (probably a Repeater field), and inside that you would have an image subfield called post_slider_image.
On that post_slider_image field, you should simply change “Return value” to “Image Array”.
If it is a repeater field (post_slider_images) with a subfield (post_slider_image), your code for printing the image should then look like this:
<div class="gallery cycle-slideshow clearfix" data-cycle-timeout="6000">
<?php if(have_rows('post_slider_images')): ?>
<?php while(have_rows('post_slider_images')): the_row(); ?>
<?php $image_data = get_sub_field('post_slider_image'); ?>
<img src="<?php echo $image_data['url']; ?>" alt="<?php echo $image_data['alt']; ?>" />
<?php endwhile; ?>
<?php endif; ?>
</div>
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.