Created
April 16, 2019 17:48
-
-
Save skyshab/25e58ee9b16b8f128f1efcd3f3c22dec to your computer and use it in GitHub Desktop.
Add body class to events with a particular category
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 // <== dont copy this line if your functions.php file already has the php opening tags | |
add_filter('body_class','my_add_custom_body_class'); | |
function my_add_custom_body_class($classes) { | |
if( is_singular('tribe_events') && has_term( 'freeevents', 'tribe_events_cat' ) ) { | |
$classes[] = 'is-free-event'; | |
} | |
return $classes; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment