From 37aae9f46f86b83b13951f54722db312c6da84a9 Mon Sep 17 00:00:00 2001 From: markjaquith Date: Wed, 5 Oct 2011 17:20:43 +0000 Subject: [PATCH] Give custom background CSS more specificity. props GaryJ. fixes #18698 git-svn-id: http://svn.automattic.com/wordpress/trunk@18886 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post-template.php | 5 ++++- wp-includes/theme.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 7ea260dda..308111bf5 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -434,7 +434,7 @@ function get_body_class( $class = '' ) { // Post Format if ( post_type_supports( $post->post_type, 'post-formats' ) ) { $post_format = get_post_format( $post->ID ); - + if ( $post_format && !is_wp_error($post_format) ) $classes[] = 'single-format-' . sanitize_html_class( $post_format ); else @@ -507,6 +507,9 @@ function get_body_class( $class = '' ) { if ( is_admin_bar_showing() ) $classes[] = 'admin-bar'; + if ( get_background_image() || get_background_color() ) + $classes[] = 'custom-background'; + $page = $wp_query->get( 'page' ); if ( !$page || $page < 2) diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 305c86b6a..073c8dfd4 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -1793,7 +1793,7 @@ function _custom_background_cb() { } ?>