Skip to content

Instantly share code, notes, and snippets.

@markusvonplunkett
Created May 4, 2017 11:41
Show Gist options
  • Save markusvonplunkett/894051874c4673d9342cf5c3fdfd267c to your computer and use it in GitHub Desktop.
Save markusvonplunkett/894051874c4673d9342cf5c3fdfd267c to your computer and use it in GitHub Desktop.
Old way of getting an alt tag
$body_image_1 = wp_get_attachment_image_src( get_field('body_image_1'), 'medium_landscape_1' );
$body_image_2 = wp_get_attachment_image_src( get_field('body_image_2'), 'medium_landscape_1' );
<img src="<?php echo $body_image_1[0]; ?>" alt="<?php echo $body_image_1['alt']; ?>" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment