diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index e242c22119..e42ac46a7a 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -501,10 +501,7 @@ function get_body_class( $class = '' ) { if ( is_admin_bar_showing() ) $classes[] = 'admin-bar'; - if ( get_theme_mod( 'background_image' ) || get_theme_mod( 'background_color' ) || - ( '_custom_background_cb' != get_theme_support( 'custom-background', 'wp-head-callback' ) - && ( get_theme_support( 'custom-background', 'default-image' ) || - get_theme_support( 'custom-background', 'default-color' ) ) ) ) + if ( get_background_color() || get_theme_mod( 'background_image' ) || get_theme_support( 'custom-background', 'default-image' ) ) $classes[] = 'custom-background'; $page = $wp_query->get( 'page' ); diff --git a/wp-includes/theme.php b/wp-includes/theme.php index f0c932dc99..409982c0e9 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -1102,10 +1102,10 @@ function background_color() { * @access protected */ function _custom_background_cb() { - $background = get_theme_mod( 'background_image' ); + $background = get_background_image(); $color = get_theme_mod( 'background_color' ); - if ( ! $background && ! $color ) + if ( ! $background && ! $color && ! get_theme_support( 'custom-background', 'default-image' ) ) return; $style = $color ? "background-color: #$color;" : ''; @@ -1129,6 +1129,8 @@ function _custom_background_cb() { $attachment = " background-attachment: $attachment;"; $style .= $image . $repeat . $position . $attachment; + } elseif ( get_theme_support( 'custom-background', 'default-image' ) ) { + $style .= " background-image: none;"; } ?>