I tried several days to accomplish this, tried several code snippets, aparent solutions, but none of them accomplished that what I want.
I simply want to remove all body classes and only add the top-level categry name (not ID!) to the body class.
These are my categories:
"Apples" is the top-level category, "Juice" and "Cake" are both subcategories. So what I want is to add the class "apples" to the body on
and all articles inside these categories.
A simply solution must exist.