Created
July 25, 2017 03:13
-
-
Save manhleo93/cd089691ab06d0cd1d3f313402e10126 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
//* Grid Style Content Archive | |
function be_archive_post_class( $classes ) { | |
// Don't run on single posts or pages | |
if( !is_home() ) | |
return $classes; | |
$classes[] = 'one-half'; | |
global $wp_query; | |
if( 0 == $wp_query->current_post || 0 == $wp_query->current_post % 2 ) | |
$classes[] = 'first'; | |
return $classes; | |
} | |
add_filter( 'post_class', 'be_archive_post_class' ); | |
function he_archive_post_class( $classes ) { | |
// Don't run on single posts or pages | |
if( !is_category() ) | |
return $classes; | |
$classes[] = 'one-half'; | |
global $wp_query; | |
if( 0 == $wp_query->current_post || 0 == $wp_query->current_post % 2 ) | |
$classes[] = 'first'; | |
return $classes; | |
} | |
add_filter( 'post_class', 'he_archive_post_class' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment