okay, ich glaube jetzt habe ich es hinbekommen!
Als erstes noch mal mein Code in der functions.php, wo ich eigene Farben in die colors-Section von WP integriere:
PHP
function bubbles_customize_register( $wp_customize ) {
$wp_customize->add_setting( 'body_background_color' , array(
'default' => '#fff',
'transport' => 'postMessage',
) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'body_background_color', array(
'label' => 'Hintergrundfarbe Body',
'section' => 'colors',
'settings' => 'body_background_color',
) ) );
}
add_action( 'customize_register', 'bubbles_customize_register' );
Alles anzeigen
Mit alchymyth Code habe ich dann die style.php bestückt. Damit funktionierten dann schon mal die CSS Werte aus der style.php:
PHP
<?php
header("Content-type: text/css");
require('../../../wp-load.php'); // Include Wordpress
?>
body{background-color:<?php echo get_theme_mod('body_background_color'); ?>;}
Für die Preview musste ich dann noch ein Javascript (theme-customizer.js) anlegen:
PHP
( function( $ ) {
wp.customize( 'body_background_color', function( value ) {
value.bind( function( newval ) {
$('body').css('background-color', newval );
} );
} );
} )( jQuery );
welches ich dann über die functions.php eingebunden habe:
PHP
function bubbles_customizer_live_preview() {
wp_enqueue_script(
'mytheme-themecustomizer',
get_template_directory_uri() . '/js/theme-customizer.js',
array( 'jquery','customize-preview' ),
'',
true
);
}
add_action( 'customize_preview_init', 'bubbles_customizer_live_preview' );
Das ganze hab ich mir mal aus dem codex zusammen gesammelt: http://codex.wordpress.org/Theme_Customiz…_.28Optional.29
Und noch mal danke an Alle!