Whenever I change customizer settings, it gets applied to current parent theme AND child theme.

If I change customizer settings on child theme, and then switch back to parent theme, the customizer settings from child theme are repopulated on parent theme...

Is there a way to preserve customizer theme settings separate from parent to child and vice versa?

  • This isn't the default behaviour of the customiser. This would only happen if the customiser settings were set to be the 'option' type, which stores values independently of the current theme. – Jacob Peattie Oct 2 '19 at 10:45
  • I tried to clone the theme, and then use that, but still, the customizer settings are persistent, I changed the theme name is styles.css, but didn't work, how can I clone the theme so it can act as a separate independent theme? Even if it's the same theme, just different name? – Bruno Vincent Oct 3 '19 at 4:43
  • You'll need to find where the customer controls are registered (it'll be something like $wp_customize->add_setting() inside the customize_register hook), and remove 'type' => 'option'. Then you'll need to change the get_option() calls for these settings to get_theme_mod(). – Jacob Peattie Oct 3 '19 at 5:02
  • I found this file: W:\Core\01-XMP7\htdocs\pros\wp-content\themes\generatepress\inc\customizer.php , and then I tried to find and replace, but not sure what code to use...! I kind of understand your instructions, but not enough, so broke my theme! – Bruno Vincent Oct 3 '19 at 9:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.