From 95ac3fc067141b7991813dd119b656565ca36795 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 20 Oct 2010 09:32:16 +0000 Subject: [PATCH] Body classes for custom taxonomies and terms. props nkuttler, fixes #15017. git-svn-id: https://develop.svn.wordpress.org/trunk@15856 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/post-template.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index d01b5003c6..2a8a2d6bd1 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -422,6 +422,10 @@ function get_body_class( $class = '' ) { $tags = $wp_query->get_queried_object(); $classes[] = 'tag'; $classes[] = 'tag-' . sanitize_html_class( $tags->slug, $tags->term_id ); + } elseif ( is_tax() ) { + $term = $wp_query->get_queried_object(); + $classes[] = 'tax-' . sanitize_html_class( $term->taxonomy ); + $classes[] = 'term-' . sanitize_html_class( $term->slug, $term->term_id ); } } elseif ( is_page() ) { $classes[] = 'page';