Home › Forums › Add-ons › Repeater Field › REPEATER IMAGE ALT TAG › Reply To: REPEATER IMAGE ALT TAG
You’ll need to have the image set as Image ID
then use something like:
<?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); ?> <img src="<?php echo $image; ?>" alt="<?php echo $alt; ?>" />
You’ll need to edit it to go in amongst your loop but hopefully you’ll get the jist.
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!
💻 The next ACF Chat Fridays features a live demo of one of our most highly-requested features: registering CPTs and custom taxonomies directly in ACF. Don’t miss it!— Advanced Custom Fields (@wp_acf) February 27, 2023
📆 Friday 3rd March 3pm UTC
👉 Register here - https://t.co/3UtvQbDwNm pic.twitter.com/j4r4ouQtz9
© 2023 Advanced Custom Fields.