Skip to content

Instantly share code, notes, and snippets.

@chrisguitarguy
Created February 24, 2016 16:29
Show Gist options
  • Save chrisguitarguy/b63d3c146d5c0c9f69c0 to your computer and use it in GitHub Desktop.
Save chrisguitarguy/b63d3c146d5c0c9f69c0 to your computer and use it in GitHub Desktop.
<?php
$query = new \WP_Query(array(
// ...
));
foreach ($query->chunk(4) as $chunk): ?>
<div class="row">
<?php while ($chunk->have_posts()): $chunk->the_post(); ?>
<div class="col-md-3 col-sm-12">
<?php the_title(); ?>
</div>
<?php endwhile; ?>
</div>
<?php endforeach; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment