Created
September 7, 2023 04:31
-
-
Save chekle/6ecdc9d2cf479ea1bd71848d6d633eb4 to your computer and use it in GitHub Desktop.
Alternating layouts ACF / PHP
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
<?php $counter = 0; if(get_sub_field('timeline')): ?><?php while(has_sub_field('timeline')): ?> | |
<?php if ($counter % 2 === 0) :?> | |
<?php else: ?> | |
<?php endif; ?> | |
<?php $counter++; endwhile; ?><?php endif; ?> | |
--------------------------- | |
$layout = 1; | |
<?php if ( $layout & 1 ) { ?> | |
<?php } else { ?> | |
<?php } ?> | |
$layout++; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment