Created
October 12, 2013 18:15
-
-
Save jaredatch/6953071 to your computer and use it in GitHub Desktop.
Create grid using default Genesis 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 | |
/** | |
* 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