• Enfold is the theme I use. And I did quit a bit of customizing on different CSS files, the header.php the functions.php and maybe some that I cannot remember.
    I did not know I had to create a Child Theme to not loose all the customizing when update stuff.
    How can I create a Child Theme of a site that I already developed on my local host .. ?!

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi misscosmicdotcom!

    You can create child theme by following this https://codex.www.ads-software.com/Child_Themes
    Create a new folder on your theme directory, wp-content/themes
    Name the folder Enfold-child.
    Copy the CSS files as well as the files you did some customization like you’ve mentioned header.php , functions.php and other files you think you customized and paste it on your child theme.
    On your theme, activate your Enfold-child and update your parent theme.

    Hope that helps.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    You know copying over the functions.php file into the Child Theme breaks the website?

    Thread Starter misscosmicdotcom

    (@misscosmicdotcom)

    No Andrew I don’t know, very new to WordPress also.. But thank you for the warning. So what if I made changes in the functions.php and I would like to keep them.
    I realize it is a bit working the wrong way around what i do now, thats just because I only came to know about creating a Child Theme when I had customized already ..

    If you have change a lot on functions.php file can break a website, as far as I know functions.php is the heart of the theme. But if you would copy it first and then do the customization then you are safe because you have a copy of the file in case you’ve done it wrong.
    In your case,you said you already done some customization on your functions.php file that’s why I suggested to copy it to your child theme. If you’ve done that well then everything will be fine because once you update the parent theme, all the customization you’ve done previously will vanished, just like you have restored it, everything will be back to it’s default.
    I am using responsive theme on my website, in my child theme I have copied the functions.php also and it still works fine.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    that’s why I suggested to copy it to your child theme.

    I am using responsive theme on my website, in my child theme I have copied the functions.php also and it still works fine.

    Don’t do that, really don’t. It’s very poor advice and it’s not necessary. The functions can be loaded via the parent theme and duplicating them only works if the theme is designed to work around things like that i.e. check if the function exists already.

    Most themes are not designed that way.

    Give this a read https://themeshaper.com/2008/07/02/functions-php-wordpress-child-themes/ for a very good example of the right way to do it.

    That site is great for learning how to modify existing themes and their functions using a child theme.

    I have a copy of functions.php on my child theme for some customization, and forgot to mention that I did change the folder file name into “Theme Functions” and I didn’t change anything on the original functions.php, its just for a pure customization I need.
    Thanks Jan for the link and I hope I made it clear.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Create Child theme for already developed (local) site ..’ is closed to new replies.