Home › Forums › Add-ons › Repeater Field › REPEATER IMAGE ALT TAG › Reply To: REPEATER IMAGE ALT TAG
It doesn’t seem to be working. Its using a repeater to add new images for a image slider i have. Is that why its not working? And yes its set up to display image ID now.
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
<?php
$attachment_id = get_sub_field('illustrations_image');
$size = "full"; // (thumbnail, medium, large, full or custom size)
$image = wp_get_attachment_image_src( $attachment_id, $size );
$attachmentinfo = get_post( $attachment_id );
$alt = get_post_meta($attachmentinfo->ID, '_wp_attachment_image_alt', true);
?>
<ul class="slider">
<li><img src="<?php echo $image[0]; ?>" alt="<?php echo $alt; ?>" /><li>
</ul>
</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!
❓Ever wondered when and why ACF uses JSON instead of the database? Check out our summary of the most recent session of ACF Chat Friday for the answer, and make sure to register for the next session.
— Advanced Custom Fields (@wp_acf) February 23, 2023
👉 https://t.co/3UtvQbDwNmhttps://t.co/wfFEVcXVKc
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.