I'm using the code below to add some CSS to the head of the page with settings from the WordPress Customizer:
public static function header_output() {
?>
<!--Customizer CSS-->
<style type="text/css">
<?php self::generate_css('#site-title a', 'color', 'header_textcolor', '#'); ?>
<?php self::generate_css('body', 'background-color', 'background_color', '#'); ?>
<?php self::generate_css('a', 'color', 'link_textcolor'); ?>
<?php self::generate_css('#wrapper-1', 'background-color', 'section_1_background_color'); ?>
<?php self::generate_css('#wrapper-1', 'background-image', 'section_1_background_image'); ?>
</style>
<!--/Customizer CSS-->
<?php
}
Everything works fine except the background-image because it outputs:
#wrapper-1 { background-image:filename.jpg; }
instead of:
#wrapper-1 { background-image: url("filename.jpg"); }
Does anyone know the proper way to modify the line of php below to include url(" ") around the image?
<?php self::generate_css('#wrapper-1', 'background-image', 'section_1_background_image'); ?>
Referencing https://codex.wordpress.org/Theme_Customization_API#Sample_Theme_Customization_Class ...
Expand the theme customization class with a generate_css function like this: