diff --git a/wp-includes/js/customize-preview.dev.js b/wp-includes/js/customize-preview.dev.js index 6d2540f90..36c4a6a85 100644 --- a/wp-includes/js/customize-preview.dev.js +++ b/wp-includes/js/customize-preview.dev.js @@ -81,15 +81,28 @@ }); api.when.apply( api, bg ).done( function( color, image, position_x, repeat, attachment ) { - var style = $('#custom-background-css'), + var body = $(document.body), + style = $('#custom-background-css'), update; - if ( ! style.length ) + // If custom backgrounds are active and we can't find the + // default output, bail. + if ( body.hasClass('custom-background') && ! style.length ) return; + // Create the CSS container if it doesn't already exist. + if ( ! style.length ) + style = $('