Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1133660

    Hi,

    I was developing my site some time and it looks quite good however i would like to start adding some modifications using the child theme.

    I have installed the child theme accordingly to the instructions here:

    but after activating child theme my site was gone so i returned to the enfold parent theme (by activating original theme).

    Please provide the instructions to activate child theme correctly without loosing already done work

    • This topic was modified 5 years, 3 months ago by papadopulos.
    #1133735

    I may find solution here:

    but in that code below, should I replace the “parent-style” with some other $handle?

    And the second question – they wrote that it will work only if theme has one .css file. Do enfold have one or more?

    <?php
    add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
    function my_theme_enqueue_styles() {
     
        $parent_style = 'parent-style'; // This is 'twentyfifteen-style' for the Twenty Fifteen theme.
     
        wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'child-style',
            get_stylesheet_directory_uri() . '/style.css',
            array( $parent_style ),
            wp_get_theme()->get('Version')
        );
    }  
    #1133901

    Hi,

    Thanks for the update, I’m not sure I understand the problem when you activate the child theme though, what exactly do you mean by “your site was gone”?

    Best regards,
    Rikard

    #1133910

    Hi,

    Sorry for unclear description.
    It means that after activating child theme whole settings are set do default so the website looks totally different.

    I am aware that after activating the child theme i should somehow import the style data from the parent theme but as it is stated in wordpress develpers resources quoted above using import functions is not correct anymore.

    So i’m trying to do it as they recommend by adding a code to the function php of child theme. The code is also in my second post but it is not working. I would like to ask you to look at this code and advise what i could change to make it work for enfold theme. They also suggesting that this code work only for themes where all style options are cover by one file style.css, otherwise there is additional procedure.

    Is what i want to achieve clear now?

    #1134211

    Hi,

    Thanks for the update. Once you have activated the child theme then you should go to Enfold->Import/Export and select to import the settings from the parent theme in there. If the settings don’t apply after that then please try goggling a theme setting and save, they should apply after that. Also make sure that you have selected to delete the old CSS and JS files under Enfold->Performance if you have file compression active.

    Best regards,
    Rikard

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