Last active
January 3, 2016 12:49
-
-
Save kristarella/8464953 to your computer and use it in GitHub Desktop.
Grid loop for homepage (with HTML 5 removal of post footer).
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
<?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(); |
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
add_image_size('grid-thumbnail', 500, 200, TRUE); |
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
.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