/**
*WordPress 把当前文章分类的别名添加到 body 标签的 class
*https://www.weixiaoduo.com/add-category-to-single/
*/
functionBing_add_category_to_single($classes){
if(!is_single())return$classes;
global$post;
foreach((get_the_category($post->ID))as$category)$classes[]=$category->category_nicename;
return$classes;
}
add_filter('body_class','Bing_add_category_to_single');