• Resolved rebornhairppp

    (@rebornhairppp)


    Hello guys,

    First off, kudos to a job well done. This is by far the simplest and intuitive child theme creator I have come across. Your tutorial videos too are extremely easy to follow. Thank you for dispelling clear instructions.

    I am running the Rare 3.0.0 theme from Visual Modo on https://www.resurrectedhair.net/testingppp11.
    This is my first time installing a child theme using your plugin. I have watched your videos on creating a new and configuring an existing child theme.

    a) I have already created and activated a new child theme named rare-child with no
    problems.
    b) I have also configured an existing child theme using a separate style sheet and
    created a duplicate called rare-child-copy also without problems.

    In retrospect, when I log in via FTP, I have the following folders contained in wp-content/themes directory:

    1. Rare – this is obviously the parent theme
    2. Rare-child – the new child theme that was created in step a) above
    3. Rare-child-copy – the duplicate child theme created in step b) above

    Looking at my themes in WP dashboard, it looks like the rare child copy theme is activated.

    Here are my questions:
    1. If I am concerned about losing my changes as a result of a child theme
    update, should I be making my changes in the rare child copy theme? In other words,
    should the rare child copy theme be activated as opposed to the rare child theme?

    2. When VisualModo releases an update to their Rare theme (parent), based on my
    current child theme setup, if I am making my changes in the rare child copy theme,
    would I lose my changes as a result of the update?

    3. In the configuring your child theme video, I was confused at 6:10 where Jay says if
    you update your current preexisting theme, it will update the original instance of
    your child theme and leave your new version untouched (being the copy version in my
    example). I still have to manually port those changes over. How will I be
    able to port those changes over if I am using the rare child copy theme?

    Sorry for the lengthy post. I very much appreciate all the hard work put into answering these types of questions and in developing a resourceful plugin for us rudimentary users.

    All my best,
    Joe

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author lilaeamedia

    (@lilaeamedia)

    Joe,

    You are describing the inherent problem with published child themes:
    1. a child theme can only have one parent; and
    2. a child theme cannot have another child theme as a parent.
    Therefore: automatically updating a child theme defeats the purpose of using child themes in the first place.

    This means the answer to your questions are as follows:

    1. Yes, if you don’t want your changes overwritten by an update, you must make them in a copy of the theme that does not get updated.
    2. No, the update will not affect your copy of the child theme with this caveat: if the parent changes and the child does not explicitly override that change, then it will inherit the change.
    3. There is no good answer for this. You will need to find out what is new and determine if you need to make changes to your child theme. (Hopefully the update includes a change log.)

    Thread Starter rebornhairppp

    (@rebornhairppp)

    Hi,

    This is so confusing. Doesn’t the answer of #3 defeat the purpose of a child theme? I thought based on the answer of #1, I will not lose my changes.

    Is your answer in question #3 implying changes not made by me but by the theme developer in the form of the update?

    This will be easier if I use an example:
    Current rare parent theme version = 3.0.0
    Current rare child version = 3.0.0
    Current rare child copy version = 3.0.0

    I make my changes in child copy theme, like changing the background color from white to red.

    Version 3.0.1 is released.

    I update the parent theme version to 3.0.1.
    1. Does rare child and rare child copy get updated to 3.0.1 automatically? Based on your answers, I know rare child copy will still remain at 3.0.0. I am just still confused on whether the rare child theme will get automatically updated to 3.0.1.
    2. If the developer added a new color in 3.0.1, let’s say lime green, since I am using the rare copy, would I need to determine based on a meticulous and excruciating manual search that this new color is one of the many changes in version 3.0.1 that needs to be transferred to my current rare copy version?

    Thank you once more. I apologize for making any of this more confusing than it should be.

    Plugin Author lilaeamedia

    (@lilaeamedia)

    The version number of a child theme that you create using CTC is completely arbitrary. It defaults to the parent theme’s version, but you can set it to any value you want.

    When you update the parent, the child theme inherits the updates. It does not get updated and the version number stays the same.

    There are, however, child themes available for free and for sale that can also be updated automatically, e.g., child themes of Genesis. This is the scenario I am describing in the previous reply.

    If your child theme is not published and will not receive automatic updates, then you do not need a third copy.

    It may be useful to review my article How Child Themes Work and When They Dont.

    Thread Starter rebornhairppp

    (@rebornhairppp)

    Hello,

    I read the referenced article. I understand the version number will not change. I wasn’t implying that in my previous reply.

    However, the article didn’t talk much about the consequences of updating the parent theme. Like, what kind of an effect would that have on the child theme.

    Without getting lost in the details, all I want to know is based on my current setup, what do you mean by porting changes to my duplicate child theme? If I am not mistaken, I understand the child theme will inherit the parent’s theme updates but not the duplicate child theme.

    As such, if I am making all my changes in the duplicate child theme being it’s active and published, if the parent theme includes a new update – let’s say a new color, gadget, icon, whatever – how will I update my duplicate child theme with that update without losing my changes?

    Thank you!

    Plugin Author lilaeamedia

    (@lilaeamedia)

    I think the best way to answer this is to explain how theme data is stored in the database, and how WordPress executes theme code.

    In the WordPress options table, there is a row for each theme (including child themes) that stores all of the customizer options and menu location mappings. It has a option_name value of ‘theme_mods_’ followed by the slug (directory name) of the theme. This means that every themes options are saved separately and independently of each other.

    WordPress uses the theme_mods record for the active theme regardless of whether the active theme is a child theme. In other words, the parent theme options are NOT used if the active theme is a child theme.

    There is also an option that stores all of the widget data for each theme the same way. This is why you lose all of your widget, menu and customizer settings when you switch themes or activate a child theme.

    CTC gives you the ability to copy both the theme_mods and the menu/widget data from the parent to the child, or from an existing child to a duplicate child.

    The only thing that physically connects the child to the parent is a single line of code that checks the “Template:” value of the active theme’s style.css file.

    WordPress first executes functions.php in the active theme, if it exists. It then checks if there is a “Template:” (parent) value. If so it executes that theme’s functions.php file. Usually, the vast majority of the code stems from the second (parent) functions.php file.

    The same is true when locating templates. WordPress first checks the child theme and executes the template if it exists; if not, it checks the parent theme and so on until it finds a template to execute.

    Unfortunately this is not true with stylesheets. There are countless ways that themes load stylesheets. The bulk of CTC’s logic is in determining the best way to handle this process. The end goal is to load the child theme stylesheet last so that it can override all the styles loaded before it.

    So now to answer your original question.

    When you update a parent theme, the child theme’s functions, templates, theme_mods, widget data and stylesheets are untouched.

    Even so, the parent theme typically controls the way all of these things work, so even though the settings are saved separately, a change in the parent may affect the child theme as a result.

    In my experience, changes to the parent rarely, if ever, materially affect the child theme. When they do they are usually in the following areas:

    1. CSS Styles: selector names and/or property values are modified. If the child theme does not explicitly override a style that changes, it will inherit the change.
    2. Function names: sometimes functions names change and this breaks any action/filter hooks that depend on them.
    3. Templates: if you use custom version of template files in a child theme and the parent version changes, the child theme version should be updated to match. This happens with WooCommerce templates a lot.

    There are other subtle things that may change. The best thing to do is make a backup and read the change logs carefully when you make an update. Run some quick tests to see if there is anything glaring and then make any necessary changes.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘General Child Theme Update Questions’ is closed to new replies.