Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Looping lists in chunks/batches, as mentioned here http://blog.ign.uy/2017/loop-list-in-batches-using-twig
<?php foreach (array_chunk($photoList, 2) as $photos): ?>
<div class="grid-row">
<?php foreach ($photos as $key => $photo): ?>
<div class="grid-overlay__img-container">
<div class="grid-overlay__img" data-src="<?= $photo['url_full'] ?>"></div>
</div>
<?php endforeach; ?>
</div>
<?php endforeach; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment