HI guys, i’m trying to filter body_class to display a class if an acf field, in a wp block, exists.
I have a fieldset with a gallery field called ‘gallery_block’ inside.
I created the wpBlock through sage-acf-gutenberg-blocks v0.5.
Everything works but i need to add a class to body:
so on filters.php
add_filter(‘body_class’, function (array $classes) {
…
$gallery = get_field(‘gallery_block’, get_queried_object_id());if (!empty($gallery) {
$classes = ‘enable-slider’;
}…
return array_filter($classes);
…
and now i’m stuck here because the class doesn’t show up.
Thanks for any suggestion.