Home Forums Plugins WP Child Theme Generator How to Implement a Child Theme

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #66028
    Leon Tan
    Participant

    Hi,

    I’m having difficulty installing a child theme for ‘Travel Eye Pro’. Whenever I implement the child theme, it seems to invoke the free version of the theme. Most baffling instance of a child theme implementation I’ve ever seen.

    Has anyone ever encountered this/know a work around?

    Cheers

    #66058
    wensolutions
    Keymaster

    Hello @leontan15,

    When you create the child theme of either pro/free version it won’t have any effect on either of them.

    Also when we checked the issue by creating the child theme of Pro version, free version remains unaffected.

    So please once try by creating the child theme of Travel Eye Pro theme by using the plugin given below:

    https://wordpress.org/plugins/wp-child-theme-generator/

    Please remove the child theme that you have previously created.

    Hope this helps.

    If you have any confusion further, please let us know.

    Best Regards!!

    #66143
    Leon Tan
    Participant

    Hiya,

    That’s a neat plugin, but unfortunately it yields the same results. The primary theme always activates the theme perfectly, but whenever a child theme is created and activated, then the theme returns to it’s demo state.

    As you can see from our staging site, the child theme I implemented with your recommended plugin still displays the demo sites settings: http://ab7.f99.myftpupload.com/

    Any advice?

    Cheers

    #66235
    wensolutions
    Keymaster

    Hello @leontan15,

    Actually, the thing is the plugin will generate the child theme of the parent theme will not tranfer the customizer setting that you have made in your original parent theme.

    Not only with this plugin even if you create the child theme maually, you need to renter the setting in customizer of the child theme.

    However, we do have the custom code which will import the parent theme customizer setting to the child theme.

    So please add below given block of code to your child themes functions.php file which you have created.

    function travel_eye_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', 'travel_eye_pro_child_customizer_options_import');

    Hope this helps.

    Best Regards!!

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.