Skip to content

Instantly share code, notes, and snippets.

@chekle
Created August 14, 2023 23:21
Show Gist options
  • Save chekle/90140926d2b9e6b848a01849896a5a20 to your computer and use it in GitHub Desktop.
Save chekle/90140926d2b9e6b848a01849896a5a20 to your computer and use it in GitHub Desktop.
ACF Repeater Field Odd / Even layouts
<?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; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment