Created
January 25, 2015 14:16
-
-
Save daliborgogic/52d23a285b9a1043ad50 to your computer and use it in GitHub Desktop.
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
<?php | |
$headerImageDesktop = get_field('header_image_desktop', 'option'); | |
$headerImageTablet = get_field('header_image_tablet', 'option'); | |
$headerImageMobile = get_field('header_image_mobile', 'option'); | |
if ( $headerImageDesktop && $headerImageTablet && $headerImageMobile ): ?> | |
<div class="headerConatiner"> | |
<div class="headerImage"> | |
<!-- <img id="foo" | |
src="<?php //echo $headerImageDesktop['url']; ?>" | |
srcset="<?php //echo $headerImageDesktop['url']; ?> 1024w, <?php //echo $headerImageTablet['url']; ?> 960w, <?php //echo $headerImageMobile['url']; ?> 638w" | |
sizes="100vw" | |
alt="" > --> | |
<picture> | |
<!--[if IE 9]><video style="display: none;"><![endif]--> | |
<source srcset="<?php echo $headerImageDesktop['url']; ?>" media="(min-width: 960px)"> | |
<source srcset="<?php echo $headerImageTablet['url']; ?>" media="(min-width: 638px)"> | |
<img id="foo" srcset="<?php echo $headerImageMobile['url']; ?>" alt=""> | |
<!--[if IE 9]></video><![endif]--> | |
</picture> | |
</div> | |
</div> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment