Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Dante › How do I update a child theme?
New Landing › How can we help? › Themeforest Theme Support › Dante › How do I update a child theme?
- This topic has 9 replies, 4 voices, and was last updated 8 years by Rui Guerreiro – SUPPORT.
-
Posted in: Dante
-
September 30, 2016 at 10:43 am #293904
Hello,
I started using a child theme. Now, when you have a theme update, how will I update the theme?
The same way? I would like not to loose all the php settings that I am adding.Thank you,
Joanna
September 30, 2016 at 11:34 am #293911Hi
You don’t need to update the child theme, only your custom changes should be in the child theme, all of the other files are in the parent theme and will be updated via the parent theme
– Kyle
September 30, 2016 at 12:20 pm #293920Hi,
I am not sure if I understand. Right now, I have managed to activate the child theme so I believe that all the php changes happen on that? I am little confused here how it works so I would appreciate some help with explaining.
For example, when I wanted recently to change this file: dante/swift-framework/widgets/widget-posts.php I would not find it in the child theme so I changed the php in Dante folder. Does it mean that when I update the theme this changes will be lost?
So if there is a theme update what do I do?
Thank you for your time,
Joanna
September 30, 2016 at 4:15 pm #293964Hi Joanna,
You don’t need to unless you are overriding specific PHP functions from the parent theme. Just keep the parent theme updated always as this powers the theme.
In the case of the widgets, those cannot be overridden in the child theme so changes have to be kept in the parent theme and re-added when you update.
Thanks,
David.October 3, 2016 at 7:15 am #294076Hi there,
Sorry for silly questions but I thought that the reason to have the child theme is so I do not have to worry about losing custom changes that I do in the code? I was recommended to do that in this support. So I am a little confused, how would my child theme be useful now?
Also, how would I keep track of the php changes with every update? After each update should I overwrite the php files with my backup from before the update?Thank you for your time,
Joanna
October 3, 2016 at 9:52 am #294085Hi Joanna,
The child theme is used if you want to add large custom CSS changes or override PHP functions. Changes made within a child theme are not overwritten on a theme update, the parent theme files are though. Here are the WP docs on the subject: https://codex.wordpress.org/Child_Themes.
What PHP changes have you made specifically in your child theme? If you have added a PHP function to the child theme
functions.php
file you can copy in the new updated function (if updated) from the parent theme files. To check if the function was updated you can view the theme changelog which would indicate this.Thanks.
October 3, 2016 at 10:23 am #294100Hello,
Thank you, I understand better now. Below the list of changes that I have made recently in php.
Can I upload it to the child theme functions.php file to have it saved? If yes, then how would I write it and where would I add it?1. Thumbnail Image sizes:
dante/swift-framework/page-builder/builder/shortcodes/recent-posts.php
$image = sf_aq_resize( $thumb_img_url, 350, 350, true, false);dante/swift-framework/widgets/widget-posts.php
$image = sf_aq_resize( $thumb_img_url, 100, 100, true, false);2. Posts date:
single.php
I changed this code: Posted on -> Last UpdatedSo how would it be possible to keep this 2 changes with child theme when making the update?
Also, once the update is available, should I just click on update, while the child theme is activated? Wouldn’t that update the child theme?
Thank you,
Joanna
October 3, 2016 at 10:39 am #2941041) No this cannot be overridden via a child theme.
2) You should have copied the entire single.php file to the child theme folder.
3) An update is only updating the theme the update is for, you will not get an update notice for the child theme as this is a separate theme entirely from the parent theme.
October 3, 2016 at 10:49 am #294109Hello,
OK, thank you very much for all the explanation! I understand now!
Joanna
October 3, 2016 at 11:13 am #294119No problem. Thanks David.
-Rui -
Posted in: Dante
You must be logged in and have valid license to reply to this topic.