Body classes for custom taxonomies and terms. props nkuttler, fixes #15017.
git-svn-id: http://svn.automattic.com/wordpress/trunk@15856 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d71913bcce
commit
a38103b1a9
|
@ -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';
|
||||
|
|
Loading…
Reference in New Issue