This commit is contained in:
Jonas Heinrich 2022-03-10 18:41:23 +01:00
parent 629d1a9b62
commit 0e42a9bda0
5 changed files with 52 additions and 36 deletions

View file

@ -23,6 +23,18 @@ add_action( 'after_setup_theme', 'fachwerksauna_setup' );
function theme_customize_register( $wp_customize ) {
$wp_customize->add_setting( 'theme_color', array(
'default' => '#ed9b40',
'transport' => 'refresh',
) );
$wp_customize->add_control( new WP_Customize_Color_Control(
$wp_customize, 'theme_color', array(
'section' => 'colors',
'label' => esc_html__( 'Theme color', 'theme' ),
) ) );
$wp_customize->add_setting( 'fachwerksauna_footer-text', array(
'default' => '',
'type' => 'option',
@ -42,4 +54,18 @@ function theme_customize_register( $wp_customize ) {
}
add_action( 'customize_register', 'theme_customize_register' );
add_action( 'customize_register', 'theme_customize_register' );
function kit_customize_css()
{
$theme_color = get_theme_mod('theme_color', '#ed9b40');
?>
<style type="text/css">
:root {
--themeColor: <?php echo $theme_color; ?>;
}
</style>
<?php
}
add_action( 'wp_head', 'kit_customize_css');