Hello Stiofan,
Thanks for your response. You’ve pointed me in the right direction. Actually I was wanting to set the body class depending on which category the Place was in. Using the function
is_tax('gd_placecategory', 'taxonomy term')
For me the taxonomy term works so if my Places Category is for example “shops” then the following would detect the Category of ‘shops’ and insert the class of XXXshopsXXX in the body class.
function my_custom_body_class_in_category( $classes ) {
if ( is_tax( 'gd_placecategory','shops' ) ){
$classes[] = 'XXXshopsXXX';
} elseif ( is_tax( 'gd_placecategory','stay' ) ){
$classes[] = 'XXXstayXXX';
} elseif ( is_tax( 'gd_placecategory','services' ) ){
$classes[] = 'XXXservicesXXX';
} else{
// do something else
}
// return the modified $classes array
return $classes;
}
add_filter( 'body_class','my_custom_body_class_in_category' );
Thanks for your input !
CC