Home › Forums › Pro Themes › Education Hub Pro › Switch back to parent theme from child theme not retaining Parent theme settings
- This topic has 3 replies, 2 voices, and was last updated 6 years, 8 months ago by wensolutions.
-
AuthorPosts
-
February 21, 2018 at 1:18 am #66404Pethick PethickParticipant
Hi,
We would like to create child theme for “Education Hub Pro”.Tried with default child theme setup by following below steps:
1. Creating “education-hub-pro-child” directory in theme directory and placed style.css and functions.php files2. Activated child theme it not retain parent theme setting then switch back parent theme completely lost parent theme settings like log, design issues and additional link in header section.
Here is sample child theme preview that confilict with parent refer screen cast: https://screencast-o-matic.com/watch/cFnr1Xo91T
Education Hub Pro theme is not switching comparability form child theme to parent theme also not retaining parent theme settings properly
Let us know way to fix this issue.
Thanks
February 21, 2018 at 6:42 am #66425wensolutionsKeymasterHello @timechart,
First of all thank you very much for using the pro version of the theme.
Yes, the child theme will not import the customizer setting of the parent theme.
However, you can import the parent theme setting to the child theme by adding the below-given custom code.
For this add the code given below in your child theme functions.php file
education_hub_pro_child_customizer_options_import() { if ( get_stylesheet() !== get_template() ) { add_filter( 'pre_update_option_theme_mods_' . get_stylesheet(), function ( $value, $old_value ) { update_option( 'theme_mods_' . get_template(), $value ); return $old_value; // prevent update to child theme mods }, 10, 2 ); add_filter( 'pre_option_theme_mods_' . get_stylesheet(), function ( $default ) { return get_option( 'theme_mods_' . get_template(), $default ); } ); } } add_action('init', 'education_hub_pro_child_customizer_options_import');
Also not to forget it is always the best idea to go through the child theme for any modification in the parent theme as the original theme file will be safe and protected.
Hope this helps.
Best Regards!!
Have a good day 🙂 .
February 22, 2018 at 7:29 pm #66557Pethick PethickParticipantThank you very much. This solution has worked well.
February 23, 2018 at 12:46 am #66568wensolutionsKeymasterHello @timechart,
Glad to know your issue has been resolved.
If you have any queries/issues further, please feel free to post your queries here.
Best Regards !!
-
AuthorPosts
- You must be logged in to reply to this topic.