How to fetch Alternative text from ACF

Alt-Text

→Go to ACF field creation settings
→Set the Image field type to the ‘image array’ option.
→We can get the URL and Alternative text from its get_field().

<?php	$image = get_field('img_field_name'); ?>
 <img src="<?php echo esc_url($image['url']); ?>" alt="<?php echo $image['alt']; ?>"/> 

Leave a comment

Your email address will not be published. Required fields are marked *