Custom background color fixes. see #12186

git-svn-id: https://develop.svn.wordpress.org/trunk@13668 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2010-03-11 20:21:58 +00:00
parent d14218fcd3
commit a1d788a893
3 changed files with 33 additions and 7 deletions
+19 -4
View File
@@ -1436,8 +1436,8 @@ function add_custom_background($header_callback = '', $admin_header_callback = '
*/
function _custom_background_cb() {
$background = get_background_image();
if ( !$background )
$color = get_background_color();
if ( !$background && !$color )
return;
$repeat = get_theme_mod('background_repeat', 'repeat');
@@ -1457,11 +1457,26 @@ function _custom_background_cb() {
$attachment = 'background-attachment: scroll;';
else
$attachment = 'background-attachment: fixed;';
if ( !empty($background ) )
$image = "background-image: url('$background');";
else
$image = '';
if ( !empty($background ) )
$image = "background-image: url('$background');";
else
$image = '';
if ( !empty($color) )
$color = "background-color: #$color;";
else
$color = '';
?>
<style type="text/css">
body {
background-color: #<?php background_color(); ?>;
background-image: url('<?php background_image(); ?>');
<?php echo $image; ?>
<?php echo $color; ?>
<?php echo $repeat; ?>
<?php echo $position; ?>
<?php echo $attachment; ?>