Customizer API is saving HTML/data changes properly but any CSS change is only visible in the Customizer. After hitting "Save & Publish" the page is exactly like it used to be with no new <style>
tags in the <head>
. This is the way I declare customizer controls and settings in functions.php (mind you this is not the complete code).
$wp_customize->add_setting('design-header-background-color', array(
'default' => '#ffffff',
));
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'design-header-background-color', array(
'label' => __( 'Background color' ),
'section' => 'design-header',
'priority' => 10
)));
function design_header_background_color()
{
?>
<style type="text/css">
header { background-color: <?php echo get_theme_mod('design-header-background-color'); ?>; }
</style>
<?php
}
add_action( 'wp_head', 'design_header_background_color');
When I use the control in the Customizer I can see stuff changing properly. But after using "Save & Publish" nothing happens. As I said HTML/PHP manipulations work just fine.