Manipulating by CSS class in tag body while filtering
If it is necessary to add any special CSS class in tag <body>, it is possible with hook ‘body_class‘.
Example:
add_filter('body_class', function($classes, $class) {
global $WOOF;
if (is_object($WOOF)) {
if (woof()->is_isset_in_request_data(woof()->get_swoof_search_slug())) {
if (woof()->is_isset_in_request_data('pwb-brand')) {
if (woof()->is_isset_in_request_data('really_curr_tax') AND intval(woof()->get_request_data()['really_curr_tax']) === 23) {
$classes[] = 'term-shoes tax-product_cat';
}
}
}
}
return $classes;
}, 10, 2);
On the code above is scenario: when WOOF searching is going by ‘brand’ and current page is page of category with ID 23 – system add CSS classes ‘term-shoes tax-product_cat‘ to tag <body>.
Troubles? Ask for Support!
