Give custom background CSS more specificity. props GaryJ. fixes #18698

git-svn-id: https://develop.svn.wordpress.org/trunk@18886 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2011-10-05 17:20:43 +00:00
parent f07212c873
commit 0fe5c09e64
2 changed files with 5 additions and 2 deletions

View File

@ -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)

View File

@ -1793,7 +1793,7 @@ function _custom_background_cb() {
}
?>
<style type="text/css">
body { <?php echo trim( $style ); ?> }
body.custom-background { <?php echo trim( $style ); ?> }
</style>
<?php
}