-
-
Save pavlo-bondarchuk/63e36801b5e86fa0ebd0017b1a5cef73 to your computer and use it in GitHub Desktop.
ACF nested group
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 | |
// vars | |
$hero = get_field('hero'); | |
if( $hero ): ?> | |
<div id="hero"> | |
<img src="<?php echo $hero['image']['url']; ?>" alt="<?php echo $hero['image']['alt']; ?>" /> | |
<div class="content"> | |
<?php echo $hero['caption']; ?> | |
<a href="<?php echo $hero['link']['url']; ?>"><?php echo $hero['link']['title']; ?></a> | |
</div> | |
</div> | |
<style type="text/css"> | |
#hero { | |
background: <?php echo $hero['color']; ?>; | |
} | |
</style> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment