client-fachwerk-sauna/functions.php
2022-03-10 18:41:23 +01:00

71 lines
1.9 KiB
PHP

<?php
/**
* fachwerksauna functions and definitions
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package fachwerksauna
*/
function fachwerksauna_setup() {
register_nav_menus(
array(
'primary' => esc_html__( 'Primary', 'fachwerksauna' ),
'secondary' => esc_html__( 'Secondary', 'fachwerksauna' ),
'footer' => esc_html__( 'Footer', 'fachwerksauna' ),
)
);
}
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',
'capability' => 'edit_theme_options'
),);
$wp_customize->add_control( new WP_Customize_Control(
$wp_customize, 'footer-text_control', array(
'label' => __( 'Footer text', 'fachwerksauna' ),
'description' => __( 'Text in footer area', 'fachwerksauna' ),
'settings' => 'fachwerksauna_footer-text',
'priority' => 10,
'section' => 'title_tagline',
'type' => 'text',
)
) );
}
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');