Hi,
I had this code snippet in my theme, in functions.php
add_filter(‘body_class’,’add_category_to_single’);
function add_category_to_single($classes) {
if (is_single() ) {
global $post;
$terms = get_the_terms( $post->ID, ‘tribe_events_cat’ );
foreach ( $terms as $term ) {
// add category slug to the $classes array
$classes[]=$term->slug;
}
}
// return the $classes array
return $classes;
}
It was working ok, but after upgrading Events Calendar, Events Calendar Pro and the filter bar addon to the last version (3.9) in no longer working. If I display the php errors, there is this message:
Warning: Invalid argument supplied for foreach()
Any help it would be appreciated.
Thanks in advance,
Victor