Created
October 30, 2016 22:18
-
-
Save celticwebdesign/60b594b5b60b691fd78f3ede109cea1d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<body | |
<?php | |
if( is_singular('things_to_do') ) { | |
// allows us to add taxonomy term to body class | |
$things_to_do_queried_object = get_queried_object(); | |
$terms = get_the_terms( $things_to_do_queried_object->ID, 'things_to_do_type' ); | |
if ( $terms && ! is_wp_error( $terms ) ) : | |
$draught_links = array(); | |
foreach ( $terms as $term ) { | |
$draught_links[] = $term->name; | |
} | |
$on_draught = join( ", ", $draught_links ); | |
endif; | |
body_class($term->slug); | |
} else { | |
body_class(); | |
} | |
?> | |
> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment