Add Category to the Body Class in WordPress

WordPress doesn’t include the category in the body classes by default, so stick this in your functions.php and hey presto, the category will be added for each post with a category assigned to it.