How to clone customizer settings in child theme from parent theme?
The customizer data is stored in table wp_options under option_name theme_mods_THEME-NAME
you can view all such settings via the following query:
SELECT * FROM `wp_options` WHERE `option_name` LIKE "theme_mods_%"
In some cases, you just want to use parent theme’s settings in newly added child theme. If that is your case too, use the following queries to utilize and close those settings for your child theme also.
update `wp_options` set `option_name`="theme_mods_YOURCHILDTHEME_backup" where `option_name`="theme_mods_YOURCHILDTHEME";
insert into `wp_options` (`option_name`,`option_value`,`autoload`) select "theme_mods_YOURCHILDTHEME",`option_value`,"yes" from `wp_options` where `option_name`="theme_mods_PARENTTHEME";
The following one is a bit risky one. If you understand what is going on here, go ahead.
delete from `wp_options` where `option_name`="theme_mods_YOURCHILDTHEME";
insert into `wp_options` (`option_name`,`option_value`,`autoload`) select "theme_mods_YOURCHILDTHEME",`option_value`,"yes" from `wp_options` where `option_name`="theme_mods_PARENTTHEME";
Leave a Reply