Skip to content

Instantly share code, notes, and snippets.

@kraftbj
Created January 4, 2013 05:50
Show Gist options
  • Save kraftbj/4450241 to your computer and use it in GitHub Desktop.
Save kraftbj/4450241 to your computer and use it in GitHub Desktop.
Custom grid loop in Genesis
<?php
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'bk_grid_loop' );
function bk_grid_loop() {
if ( function_exists( 'genesis_grid_loop' ) ) {
remove_action( 'genesis_before_post_content', 'generate_post_image', 5 );
genesis_grid_loop( array(
'features' => 2,
'feature_image_size' => 'large',
'feature_image_class' => 'aligncenter post-image',
'feature_content_limit' => 0,
'grid_image_size' => 'grid',
'grid_image_class' => 'alignleft post-image',
'grid_content_limit' => 0,
'more' => __( 'Continue reading...', 'genesis' ),
'posts_per_page' => 6,
) );
} else {
genesis_standard_loop();
}
}
genesis();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment