Skip to content

Instantly share code, notes, and snippets.

@jaredatch
Created October 12, 2013 18:15
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 jaredatch/6953071 to your computer and use it in GitHub Desktop.
Save jaredatch/6953071 to your computer and use it in GitHub Desktop.
Create grid using default Genesis loop
<?php
/**
* Tweaks to the post classes
*
* @since 1.0.0
* @param array $classes
* @return array
*/
function ja_post_class( $classes ) {
if ( is_post_type_archive( 'portfolio' ) ) {
global $wp_query;
$classes[] = "one-third";
if ( $wp_query->current_post % 3 == 0 )
$classes[] = "first";
}
return $classes;
}
add_filter( 'post_class', 'ja_post_class' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment