Created
January 3, 2012 03:33
-
-
Save billerickson/1553344 to your computer and use it in GitHub Desktop.
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
remove_action('genesis_before_post_content', 'genesis_post_info'); | |
remove_action('genesis_post_title', 'genesis_do_post_title'); | |
// Use the prepared grid loop | |
add_action( 'genesis_loop', 'minimum_tn_do_grid_loop' ); | |
function minimum_tn_grid_switch_content() { | |
remove_action('genesis_post_content', 'genesis_grid_loop_content'); | |
add_action('genesis_post_content', 'minimum_tn_grid_loop_content'); | |
} | |
add_action('genesis_before_post', 'minimum_tn_grid_switch_content'); | |
function minimum_tn_grid_loop_content() { | |
global $_genesis_loop_args; | |
if ( $_genesis_loop_args['grid_image_size'] ) { | |
printf( '<a href="%s" title="%s" rel="nofollow">%s</a>', get_permalink(), the_title_attribute( 'echo=0' ), genesis_get_image( array( 'size' => $_genesis_loop_args['grid_image_size'], 'attr' => array( 'class' => esc_attr( $_genesis_loop_args['grid_image_class'] ) ) ) ) ); | |
} | |
printf( '<a href="%s" rel="nofollow">%s</a>', get_permalink(), the_title_attribute( 'echo=0' ) ); | |
} | |
// Add some extra post classes to the grid loop so we can style the columns | |
add_filter( 'genesis_grid_loop_post_class', 'minimum_tn_grid_loop_post_class' ); | |
function minimum_tn_grid_loop_post_class( $grid_classes ) { | |
global $_genesis_loop_args, $loop_counter; | |
// Alter this number to change the number of columns - used to add class names | |
$columns = 4; | |
// Only want extra classes on grid posts, not feature posts | |
if ( $loop_counter >= $_genesis_loop_args['features'] ) { | |
// Add genesis-grid-column-? class to know how many columns across we are | |
$grid_classes[] = sprintf( 'genesis-grid-column-%s', ( ( $loop_counter - $_genesis_loop_args['features'] ) % $columns ) + 1 ); | |
// Add size1of? class to make it correct width | |
$grid_classes[] = sprintf( 'size1of%s', $columns ); | |
} | |
return $grid_classes; | |
} | |
remove_action( 'genesis_loop', 'genesis_do_loop' ); | |
add_action( 'genesis_loop', 'minimum_grid_loop_helper' ); | |
/** Add support for Genesis Grid Loop **/ | |
function minimum_grid_loop_helper() { | |
if ( function_exists( 'genesis_grid_loop' ) ) { | |
genesis_grid_loop( array( | |
'post_type' => 'projects', | |
'taxonomy' => 'classification', | |
'term' => ' identity ', | |
'features' => 0, | |
'feature_image_size' => 0, | |
// 'feature_image_class' => 'alignleft post-image', | |
'feature_image_class' => 'post-image', | |
'feature_content_limit' => 0, | |
'grid_image_size' => 'port-grid-thumbnail', | |
// 'grid_image_class' => 'alignleft post-image', | |
'grid_image_class' => 'portfolio-tn-img', | |
'grid_content_limit' => 0, | |
'more' => __( '[Continue reading...]', 'genesis' ), | |
'posts_per_page' => 20, | |
) ); | |
} else { | |
genesis_standard_loop(); | |
} | |
} | |
/** Remove the post meta function for front page only **/ | |
remove_action( 'genesis_after_post_content', 'genesis_post_meta' ); | |
genesis(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment