I have added some custom code in functions.php, what if i update the theme?

This topic has 5 replies, 2 voices, and was last updated 1 year, 7 months ago ago by Rameez Pathan

  • Avatar: Rameez Pathan
    Rameez Pathan
    Participant
    August 11, 2022 at 18:55

    I have added some custom code in functions.php, what will happen if i update the theme?

    Do i have to add that code again?

    4 Answers
    Avatar: Awais Ahmed
    Awais Ahmed
    Participant
    August 12, 2022 at 05:30

    Hello, @Rameez Pathan,

    It will override your Custom Code with the new file, so it will not work for you and you have to add the code again.
    That is why we always recommended using the Child Theme for Customization purposes, Please Install and Activate the Child Theme: https://xstore.helpscoutdocs.com/article/32-child-theme and then add/insert your Custom Code in Child Theme functions.php file, then whenever you will update the Parent Theme, your code will be safe.

    Regards 8Themes Team.

    Avatar: Rameez Pathan
    Rameez Pathan
    Participant
    August 12, 2022 at 08:41

    I never used a child theme, so I don’t know how to use it with the main theme, if you have any tutorial video or any documentation about it, please send me otherwise it is okay because I will download the code which I have added in functions.php

    Thanks

    Avatar: Awais Ahmed
    Awais Ahmed
    Participant
    August 12, 2022 at 08:45

    Hello, @Rameez Pathan,

    You just have to Install the Child Theme from Appearance >> Themes.

    Then Activate the Child Theme from Appearance >> Themes.

    Then you have to go to Cpanel >> Wp-Content/Themes and edit the xstore-child theme folder.

    You will find the functions.php file in it, simply add your code in Child Theme functions.php file and check back your site after removing the cache.

    Regards 8Themes Team.

    Avatar: Rameez Pathan
    Rameez Pathan
    Participant
    August 12, 2022 at 08:47

    wow nice, thanks for the guidance.

  • Viewing 5 results - 1 through 5 (of 5 total)

The issue related to '‘I have added some custom code in functions.php, what if i update the theme?’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.