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
This commit is contained in:
parent
5242abafb1
commit
95ac3fc067
@ -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
Block a user