How would I go about adding an ALT tag for these images? Would I have to add the
$alt = get_post_meta(get_post_thumbnail_id($post->ID), '_wp_attachment_image_alt', true);
to the array, and then add the <?php echo $alt; ?>
when displaying the image?
<?php /* 2 IMAGES DIVIDER */ ?>
<?php if($divider_type == 'images'): ?>
<section class='divider content gallery'>
<?php
$images = array();
foreach($section['images'] as $image_id => $image_url)
{
$image = wp_get_attachment_image_src($image_id, '900w');
$image_details = get_post($image_id);
$images[] = array('img_url'=>$image[0],'caption'=>$image_details->post_excerpt);
}
?>
<div class='gallery-half'>
<figure>
<img src='<?php echo $images[0]['img_url']; ?>'>
<?php if($images[0]['caption'] != ''): ?>
<figcaption><?php echo $images[0]['caption']; ?></figcaption>
<?php endif; ?>
</figure>
</div><!--
--><div class='gallery-half'>
<img src='<?php echo $images[1]['img_url']; ?>'>
</div>
</section>
<?php endif; ?>
Thank you in advance.