Skip to content

Commit 85ebd77

Browse files
authored
Update Body Color customizer
Added body color (default text color) customizer
1 parent 61680ad commit 85ebd77

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

includes/customizer.php

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,15 @@ function theme_customizer_settings($wp_customize)
8989
'priority' => 25,
9090
));
9191

92+
$wp_customize->add_setting('color_body', array(
93+
'default' => '#fff',
94+
'transport' => 'refresh',
95+
));
96+
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'color_body', array(
97+
'label' => __('Text Color', 'kinsmen-wp'),
98+
'section' => 'theme_colors',
99+
)));
100+
92101
$wp_customize->add_setting('color_primary', array(
93102
'default' => '#020815',
94103
'transport' => 'refresh',
@@ -128,14 +137,18 @@ function theme_customizer_settings($wp_customize)
128137
)));
129138

130139

140+
141+
142+
131143
}
132144

133145
add_action('customize_register', 'theme_customizer_settings');
134146

135147

136148
function custom_theme_customizer_styles()
137149
{
138-
$color_primary = get_theme_mod('color_primary', '#020815');
150+
$color_primary = get_theme_mod('color_primary', '#fff');
151+
$color_body = get_theme_mod('color_body', '#020815');
139152
$color_secondary = get_theme_mod('color_secondary', '#f48513');
140153
$color_tertiary = get_theme_mod('color_tertiary', '#7e4ef3');
141154
$color_gradient = get_theme_mod('color_gradient', '#200224cf');
@@ -144,6 +157,9 @@ function custom_theme_customizer_styles()
144157
?>
145158
<style type="text/css">
146159
:root {
160+
--body-color:
161+
<?php echo $color_body; ?>
162+
;
147163
--primary-color:
148164
<?php echo $color_primary; ?>
149165
;
@@ -161,4 +177,4 @@ function custom_theme_customizer_styles()
161177
</style>
162178
<?php
163179
}
164-
add_action('wp_head', 'custom_theme_customizer_styles');
180+
add_action('wp_head', 'custom_theme_customizer_styles');

0 commit comments

Comments
 (0)