0

I have the following code for calling the images in the slider but no idea on how to get the alt tag. I tried varied methods but I could be missing something. Please help. Possibly I am missing this in calling the respective variables but no idea thereof.

foreach ( get_field('images') as $image ): ?>
<div>
<img src="<?php echo $image['image']['url']; ?>" width="90" alt="<?php echo $alt; ?>" />
</div>
<?php endforeach;

Please help.

1
  • @JacobPeattie It could be but I am using the _wp_attachment_image_alt tag as well but as revised the content I am hereby quoting the same that I could be wrong in calling the alt tag in any way. And that is where I need help.
    – Keyur Amin
    Dec 12, 2018 at 10:44

1 Answer 1

0

I figured out the answer while doing some estimations. (and it was no where near to the suggested topics).

Change

alt="<?php echo $alt; ?>"

to

alt="<?php echo $image['image']['alt']; ?>"

Not the answer you're looking for? Browse other questions tagged or ask your own question.