Last active
August 29, 2015 14:18
-
-
Save frankschrijvers/e2812de3fe9bbc632f9d to your computer and use it in GitHub Desktop.
Custom loop for masonry page layout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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