Last active
January 14, 2017 02:40
-
-
Save studiopress/5666327 to your computer and use it in GitHub Desktop.
Genesis grid loop.
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 | |
//* Do NOT include the opening php tag shown above. Copy the code shown below. | |
//* Add new image sizes | |
add_image_size('grid-thumbnail', 100, 100, 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
/* Featured Post Grid | |
------------------------------------------------------------ */ | |
.genesis-grid-even { | |
float: right; | |
padding: 0 0 15px; | |
width: 48%; | |
} | |
.genesis-grid-odd { | |
clear: both; | |
float: left; | |
padding: 0 0 15px ; | |
width: 48%; | |
} | |
.genesis-grid-even, | |
.genesis-grid-odd { | |
margin: 0 0 20px; | |
} |
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 | |
//* 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' => 0, | |
'feature_image_class' => 'alignleft post-image', | |
'feature_content_limit' => 0, | |
'grid_image_size' => 'grid-thumbnail', | |
'grid_image_class' => 'alignleft post-image', | |
'grid_content_limit' => 0, | |
'more' => __( '[Continue reading...]', 'genesis' ), | |
) ); | |
} else { | |
genesis_standard_loop(); | |
} | |
} | |
//* Remove the post meta function for front page only | |
remove_action( 'genesis_entry_footer', 'genesis_post_meta', 10 ); | |
genesis(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment