Skip to content

Instantly share code, notes, and snippets.

@frankschrijvers
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frankschrijvers/e2812de3fe9bbc632f9d to your computer and use it in GitHub Desktop.
Save frankschrijvers/e2812de3fe9bbc632f9d to your computer and use it in GitHub Desktop.
Custom loop for masonry page layout
// Masonry loop
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'wpstudio_content_area', 'wpstudio_masonry', 30 );
function wpstudio_masonry() {
$paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;
$args = ( array(
'post_type' => 'post',
'order' => 'desc',
'order_by' => 'date',
'paged' => $paged,
'posts_per_page' => 6,
)
);
echo '<section class="blog" id="container">';
genesis_custom_loop( $args );
echo '</section>';
do_action( 'genesis_after_endwhile' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment