Skip to content

Instantly share code, notes, and snippets.

@alispx
Last active August 29, 2015 14:01
Show Gist options
  • Save alispx/38b2cf7909f5622ef716 to your computer and use it in GitHub Desktop.
Save alispx/38b2cf7909f5622ef716 to your computer and use it in GitHub Desktop.
<?php $args = array(
'post_type' => 'post_type',
'showposts' => 200,
'orderby' => 'menu_order',
'order' => 'ASC'
);
$customquery = new WP_Query( $args ); ?>
<?php
$group = 0;
while ( $customquery->have_posts() ) : $customquery->the_post();
$ifGroup = ($group % 6) == 0;
echo $containerStart = $ifGroup ? '<div class="post-group-of-2">' : ''; ?>
<div class="thepost">
<a href="#"><?php echo $post->post_name; ?></a>
<p>Description</p>
</div>
<?php echo $containerEND = $ifGroup ? '' : '<div class="clear"></div></div>';
$group++;
?>
<?php endwhile; wp_reset_query(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment