I want to add the currenty category to the body class.
How do I need to modify my current code, to add also the current category as a body class to the is_singular( 'knowledgebase' )
section?
My current code looks like this:
function add_body_class( $classes ) {
global $pakb;
if( is_page( $pakb->get( 'kb_page' ) ) && ! is_null( $pakb->get( 'kb_page' ) ) ) {
$classes[] = 'pakb-main';
} elseif ( is_tax( 'knowledgebase_category' ) ) {
$classes[] = 'pakb-category';
} elseif ( is_singular( 'knowledgebase' ) ) {
$classes[] = 'pakb-single';
}
return $classes;
}