Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created October 9, 2012 23:25
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 billerickson/3862125 to your computer and use it in GitHub Desktop.
Save billerickson/3862125 to your computer and use it in GitHub Desktop.
Customizing Grid Loop Content
/** Customize Blog Post Content */
function atb_test( $content ) {
global $post;
if( ! ( in_array( 'feature', get_post_class() ) || in_array( 'one-third', get_post_class() ) )
return $content;
// First Page Classes
if( ! $wp_query->query_vars['paged'] ) {
// Features
if( $wp_query->current_post < $grid_args['features_on_front'] ) {
$content = 'Test Front Page Feature Content';
// Teasers
} else {
$content = 'Test Front Page Teaser Content';
}
// Inner Pages
} else {
// Features
if( $wp_query->current_post < $grid_args['features_inside'] ) {
$content = 'Test Inner Page Feature Content';
// Teasers
} else {
$content = 'Test Inner Page Teaser Content';
}
}
return $content;
}
add_filter( 'the_content', 'atb_test' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment