Last active
August 29, 2015 14:01
-
-
Save emaildano/2ffc5a7ac3fb590abbc7 to your computer and use it in GitHub Desktop.
Started code for bootstrap columns container / container-fluid full backgrounds.
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 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; ?> |
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
.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; | |
} | |
} |
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
<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