Support

Account

Home Forums Add-ons Repeater Field REPEATER IMAGE ALT TAG Reply To: REPEATER IMAGE ALT TAG

  • Here’s your code with my code combined 🙂

    <?php  			
    	if(get_field('image_slider_illustrations'))
    	{
    		echo '<ul class="slider">';
    		while(has_sub_field('image_slider_illustrations'))
    		{	
    
    			$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);
    
    			echo '<li><img src="' . $image[0] . '"  alt="' . $alt  . '"/></li> ';               
    		}	 
    		echo '</ul>';
    	}	 
    ?>

    Just tried that and got the expected result – let me know if you’ve still got no joy