Created
January 17, 2017 18:41
-
-
Save verticalgrain/e5fc4fc99f15de692ef7604bc856a9d2 to your computer and use it in GitHub Desktop.
ACF Image srcset
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function responsive_image_background($image_field_name) { | |
| $imageobject = get_field($image_field_name); | |
| echo '<img class="fullscreen__image-background" src="' . $imageobject['sizes']['superhero'] . '" srcset="' . $imageobject['sizes']['superhero'] .' '. $imageobject['sizes']['superhero-width'] .'w, ' . $imageobject['sizes']['hero'] .' '. $imageobject['sizes']['hero-width'] .'w, '. $imageobject['sizes']['large'] .' '. $imageobject['sizes']['large-width'] .'w">'; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment