$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>Using ACF Pro plugin - How to get alt tags using repeater with Image ID?|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

Using ACF Pro plugin - How to get alt tags using repeater with Image ID?

matteradmin8PV0评论
This question already has answers here: How To Retrieve An Image Attachment's Alt Text? (7 answers) Closed 6 years ago.

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.

This question already has answers here: How To Retrieve An Image Attachment's Alt Text? (7 answers) Closed 6 years ago.

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.

Share Improve this question edited Dec 12, 2018 at 11:51 Keyur Amin asked Dec 12, 2018 at 10:28 Keyur AminKeyur Amin 31 silver badge4 bronze badges 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 Commented Dec 12, 2018 at 10:44
Add a comment  | 

1 Answer 1

Reset to default 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']; ?>"
Post a comment

comment list (0)

  1. No comments so far