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”. See this image

    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; ?>