New Landing How can we help? Themeforest Theme Support Dante How do I update a child theme?

Viewing 10 posts - 1 through 10 (of 10 total)
  • Posted in: Dante
  • #293904
    Joanna
    Member
    Post count: 185

    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

    #293911
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Hi

    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

    #293920
    Joanna
    Member
    Post count: 185

    Hi,

    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

    #293964
    David Martin – Support
    Moderator
    Post count: 20834

    Hi 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.

    #294076
    Joanna
    Member
    Post count: 185

    Hi 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

    #294085
    David Martin – Support
    Moderator
    Post count: 20834

    Hi 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.

    #294100
    Joanna
    Member
    Post count: 185

    Hello,

    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 Updated

    So 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

    #294104
    David Martin – Support
    Moderator
    Post count: 20834

    1) 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.

    #294109
    Joanna
    Member
    Post count: 185

    Hello,

    OK, thank you very much for all the explanation! I understand now!

    Joanna

    #294119
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    No problem. Thanks David.
    -Rui

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in and have valid license to reply to this topic.

License required for the following item
Login and Registration Log in · Register