Created
March 19, 2012 21:04
-
-
Save jo-snips/2127103 to your computer and use it in GitHub Desktop.
Thesis: Filter Body Classes
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
// Add a class for styling | |
function add_classes($classes) { | |
if('tribe_events' == get_post_type()) { | |
if ( is_single() && !tribe_is_showing_all() ) { // single event | |
$classes[] = 'single-event'; | |
} elseif ( tribe_is_upcoming() || tribe_is_past() || tribe_is_day() || (is_single() && tribe_is_showing_all()) ) { // list view | |
$classes[] = 'list'; | |
} else { // grid view | |
$classes[] = 'grid'; | |
} | |
} else { | |
} | |
return $classes; | |
} | |
add_filter('thesis_body_classes', 'add_classes'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment