• Hello,

    I am using the Storefront theme, and thinking of creating a child theme.

    I am reading this article: https://developer.woocommerce.com/docs/how-to-set-up-and-use-a-child-theme/

    Under the heading “Template changes”, it says: “Any customizations to a Storefront child theme’s files will be lost when updating.”

    Does this mean that the custom code I have added to the child theme will be deleted when I update Storefront parent theme?

    I thought the reason for creating a child theme was to avoid deleting the custom code when the parent theme is updated.

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @hans410947,

    Thank you for reaching out. It’s great to hear that you’re considering a child theme! You’re absolutely right; one of the main benefits of a child theme is to preserve your customizations when the parent theme is updated. The statement you came across in the article might be a bit confusing, so let me explain. When you update the Storefront parent theme, your child theme’s customizations will not be lost. The child theme is separate and does not get overwritten by updates to the parent theme. This means that any custom code you’ve added to your child theme’s files will remain intact.

    However, it’s important to note that if you directly modify the parent theme’s files, those changes will be lost when you update the parent theme. That’s why we recommend adding your custom code to the child theme’s files. To ensure a smooth experience with your child theme, here are a few steps you can follow:

    1. Make sure to back up your site before making changes.
    2. Create your child theme by following the steps outlined in the WooCommerce documentation here: How to set up and use a child theme.
    3. Add your custom code to the child theme’s functions.php or style.css files, depending on what you’re customizing.

    Let us know if there’s anything else we can help you with.

    Thread Starter hans410947

    (@hans410947)

    Hi @afzalpansuvi

    Perfect, that answered my question, thank you!

    • This reply was modified 7 months, 1 week ago by hans410947.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Will Storefront child theme code be deleted on update?’ is closed to new replies.