Best way to change default customizer values?
-
Hi,
I’m relatively new to WordPress theming. I did a few child themes to a couple of twenty* themes and I’m trying now to create a default theme for a small organization where all the customizer options should remain available but a few need changes to their default values.So far I’ve created a file in the child theme where I change some values as they where set in the customizer.php like this:
if ( ! function_exists( 'wpforge_child_customize_css' ) ) { function wpforge_child_customize_css() { ?> <style type="text/css" id="wpforge-child-customizer-css"> .header_wrap{max-width:<?php echo esc_attr(get_theme_mod('header_width','75rem')); ?>;background-color:<?php echo esc_attr(get_theme_mod('header_color','#B00A23')); ?>;} </style> <?php } add_action( 'wp_head', 'wpforge_child_customize_css', 110); }
But of course that doesn’t change the default color in the customizer menu. I’ve tried to re-add the setting via $wp_customize->add_setting in a similar manner to change the default value but with no success.
How would you do it?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Best way to change default customizer values?’ is closed to new replies.