Skip to content

Instantly share code, notes, and snippets.

@kristarella
Last active January 3, 2016 12:49
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 kristarella/8464953 to your computer and use it in GitHub Desktop.
Save kristarella/8464953 to your computer and use it in GitHub Desktop.
Grid loop for homepage (with HTML 5 removal of post footer).
<?php
//* Remove the post meta function for front page only
remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
//* Add support for Genesis Grid Loop
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' => 2,
'feature_image_size' => 'medium',
'feature_image_class' => 'alignright post-image medium',
'feature_content_limit' => 500,
'grid_image_size' => 'grid-thumbnail',
'grid_image_class' => 'aligncenter post-image',
'grid_content_limit' => 200,
'more' => __( '[Continue reading...]', 'genesis' ),
) );
} else {
genesis_standard_loop();
}
}
genesis();
add_image_size('grid-thumbnail', 500, 200, TRUE);
.genesis-grid-even {
float: right;
width: 48%;
}
.genesis-grid-odd {
clear: both;
float: left;
width: 48%;
}
.genesis-grid-even,
.genesis-grid-odd {
padding: 0 0 16px;
padding: 0 0 1.6rem;
margin: 0 0 20px;
margin: 0 0 2rem;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment