Skip to content

Instantly share code, notes, and snippets.

@atticoos
Last active August 29, 2015 14:07
Show Gist options
  • Select an option

  • Save atticoos/ef65f953f5663e06e233 to your computer and use it in GitHub Desktop.

Select an option

Save atticoos/ef65f953f5663e06e233 to your computer and use it in GitHub Desktop.
<div class="something">
<?php
$bannerImage = get_field('top_banner_image');
if (empty($bannerImage)) $bannerImage = get_field('default_banner_image', 'option');
?>
<header style="background-image: url(<?php echo $bannerImage; ?>)">
<h1><?php the_field('top_title'); ?></h1>
<p><?php the_field('top_excerpt'); ?></p>
</header>
<section>
<?php while(have_rows('featured_items')) : the_row();
$itemOne = get_sub_field('item1');
$itemTwo = get_sub_field('item2');
$itemThree = get_sub_field('item3');
?>
<div>
<h2><?php echo $itemOne; ?></h2>
<p><?php echo $itemTwo; ?></p>
<span><?php echo $itemThree; ?></span>
</div>
<?php endwhile; ?>
</section>
<footer>
<h1><?php the_field('bottom_title'); ?></h1>
<p><?php the_field('bottom_excerpt'); ?>
</footer>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment