Skip to content

Instantly share code, notes, and snippets.

@emaildano
Last active August 29, 2015 14:01
Show Gist options
  • Save emaildano/2ffc5a7ac3fb590abbc7 to your computer and use it in GitHub Desktop.
Save emaildano/2ffc5a7ac3fb590abbc7 to your computer and use it in GitHub Desktop.
Started code for bootstrap columns container / container-fluid full backgrounds.
<?php if( have_rows('images') ): ?>
<div class="container">
<div class="row">
<section class="image-row">
<div class="color-wrap">
<?php while ( have_rows('images') ) : the_row(); ?>
<div class="half" style="background-color:<?php the_sub_field('background_color'); ?>"></div>
<?php endwhile; ?>
</div>
<?php while ( have_rows('images') ) : the_row(); ?>
<div class="half" style="background-color:<?php the_sub_field('background_color'); ?>">
<img src="<?php
$image = get_sub_field('image');
echo $image['sizes']['full-width'];
?>" alt="<?php echo $image['alt']; ?>" />
</div>
<?php endwhile; ?>
</section>
</div>
</div>
<?php endif; ?>
.color-wrap {
// coloring container-fluid / container backgrounds
position: absolute;
z-index: -1;
left: 0;
right: 0;
.left, .right {
float: left;
height: 300px;
width: 50%;
background: #000;
}
}
<div class="container">
<div class="row">
<section class="image-row">
<div class="color-wrap">
<div class="left"></div>
<div class="right"></div>
</div>
<?php if( have_rows('images') ): ?>
<?php while ( have_rows('images') ) : the_row(); ?>
<div class="half" style="background-color:<?php the_sub_field('background_color'); ?>">
<img src="<?php
$image = get_sub_field('image');
echo $image['sizes']['full-width'];
?>" alt="<?php echo $image['alt']; ?>" />
</div>
<?php endwhile; ?>
<?php endif; ?>
</section>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment