Skip to content

Instantly share code, notes, and snippets.

@alispx
Last active August 29, 2015 14:01
Show Gist options
  • Save alispx/f7479cf9c1272d72385b to your computer and use it in GitHub Desktop.
Save alispx/f7479cf9c1272d72385b to your computer and use it in GitHub Desktop.
<?php
$args = array(
'post_type' => 'post_type',
'post_status' => 'publish',
'ignore_sticky_posts' => 1,
'posts_per_page' => 24,
'orderby' => 'date',
'order' => 'desc',
);
global $post;
$custom_query = get_posts($args );
$chunked_posts = array_chunk( $custom_query, 6 );
?>
<?php foreach ( $chunked_posts as $custom_post ) : ?>
<div class="ost-group-of-2">
<?php foreach( $custom_post as $post ) : setup_postdata( $post ); ?>
<div class="thepost">
<a id="post1" href="#"><?php the_title(); ?></a>
<p id="description1"><?php echo $post->post_content; ?></p>
</div>
<?php endforeach; ?>
</div>
<?php endforeach; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment