Add Post Category Slug to Body Class in WordPress

Sometimes you may need to style a particular post differently, based on the category that it’s in. This snippet will add post category slug to body class.