Skip to content

Instantly share code, notes, and snippets.

@mbrughi
Created December 2, 2017 08:43
Show Gist options
  • Save mbrughi/abc57c06f96bbf76ffa09bd79b026af2 to your computer and use it in GitHub Desktop.
Save mbrughi/abc57c06f96bbf76ffa09bd79b026af2 to your computer and use it in GitHub Desktop.
Genesis Grid Loop w/help
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'child_grid_loop_helper' );
function child_grid_loop_helper() {
if ( function_exists( 'genesis_grid_loop' ) ) {
genesis_grid_loop( array(
'features' => 1, // Num. post to show full size
'feature_image_size' => 650, // Size of image features post
'feature_image_class' => 'aligncenter post-image', // alignment of features image
'feature_content_limit' => 150, // number of characters of the post to show in the features section (set to 0, which will return the full content).
'grid_image_size' => 'grid-thumbnail', // Image size of other post (set in functions.php)
'grid_image_class' => 'alignleft post-image',
'grid_content_limit' => 100, // number of characters of the post to show in the features section (set to 0, which will return the full content).
'more' => __( '[Continue reading...]', 'genesis' ),
'posts_per_page' => 6,
) );
} else {
genesis_standard_loop();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment