Created
April 9, 2018 15:36
-
-
Save Coop920/024217fb41998f76cdff19658bc24693 to your computer and use it in GitHub Desktop.
3 Column Logic
This file contains 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 id="stat-wrapper"> | |
<?php if ( have_rows( 'stats' ) ) : ?> | |
<?php $count = 0; ?> | |
<div class="col"> | |
<?php while ( have_rows( 'stats' ) ) : the_row(); ?> | |
<?php $count++; ?> | |
<div class="stat"> | |
<?php if ( get_sub_field( 'stat_icon' ) ) { ?> | |
<img src="<?php the_sub_field( 'stat_icon' ); ?>" /> | |
<?php } ?> | |
<?php the_sub_field( 'stat_headline' ); ?> | |
<?php the_sub_field( 'stat_copy' ); ?> | |
</div> | |
<?php | |
if($count % 2 == 0) { echo "</div><div class='col'>"; } | |
?> | |
<?php endwhile; ?> | |
<?php else : ?> | |
<?php // no rows found ?> | |
<?php endif; ?> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment