Skip to content

Instantly share code, notes, and snippets.

@csbeck
Created March 11, 2013 14:37
Show Gist options
  • Save csbeck/5134677 to your computer and use it in GitHub Desktop.
Save csbeck/5134677 to your computer and use it in GitHub Desktop.
Genesis Grid Template
<?php
/**
* Template Name: Portfolio Grid
* This file displays a Grid within a page.
*/
add_action( 'genesis_post_content', 'genesis_do_post_content' );
/**remove_action( 'genesis_loop', 'genesis_do_loop' );**/
add_action( 'genesis_loop', 'child_grid_loop' );
function child_grid_loop() {
$args = array(
'features' => 2,
'feature_image_size' => 'grid-feature-image',
'feature_image_class' => 'alignleft post-image',
'feature_content_limit' => 500,
'grid_image_size' => 'grid-thumbnail',
'grid_image_class' => 'alignleft post-image',
'grid_content_limit' => 0,
'loop' => 'custom',
'more' => __( '[Continue reading...]', 'genesis' ),
'posts_per_page' => 12,
);
if ( genesis_get_custom_field( 'query_args' ) )
$args['cat'] = genesis_get_custom_field( 'query_args' );
genesis_grid_loop( $args );
}
/** Remove the post meta function for front page only **/
remove_action( 'genesis_after_post_content', 'genesis_post_meta' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment