Add body class to custom post type
your code only works if you are using category taxonomy. if you are using custom taxonomy like brands you must change your code to this: function add_category_to_single( $classes ) { if ( is_singular() ) { global $post; $taxonomy = ‘brands’; $terms = get_the_terms( $post->ID, $taxonomy ); if ( ! empty( $terms ) && ! is_wp_error( … Read more