Lost Custom CSS on Child theme after updating Parent (X Theme)

Hi,

After updating the parent X theme a few nights ago, I noticed that the custom CSS I had setup in the child theme disappeared. Using a back-up made a few weeks prior when the custom CSS was fine, I started digging…

It turned out that the ‘theme_mods_x-child’ option value had changed, noticeably the ‘custom_css_post_id’ parameter value was changed from ‘466’ to ‘-1’. Manually changing it back to ‘466’ solved the issue. (As 466 indicates a postId on my particular installation, this value is/will be different for you).

I have no idea how/why this happened, but even though I managed to resolve my issue, I’m posting it here as it might help others, or maybe even indicate a small bug in the update process.

  • Hendrik

Hello Hendrik,

Thanks for writing in! When updating a parent theme, any customizations made in the child theme should all be intact. How did you updated it? Did you deactivated the child theme and activated the parent theme before you have updated it? Please update the parent theme right away instead. You should be able to update it in your dashboard, Dashboard > Updates or Network Sites > Updates for multi site set up.

Hope this helps.

Hi RueNel,

Thanks for the quick reply!
I’m using the Dashboard -> Updates feature to update the plug-ins and themes.
To answer your other question: I do not disable the child theme before updating the parent.

Usually my update process is the following:

  • Backup everything
  • Update plug-ins (including Cornerstone)
  • Update themes (including X theme parent)
  • Update Wordpress (if it hasn’t automatically updated)
  • Verify and profit!

If you need any information about the versions before the update (in the backup) and after the update, I can provide them, but could use a little nudge as where to read them from (file/db/table).

  • Hendrik

Hello Hendrik,

Custom css added in the X > Theme Options > Custom css section will always be the same and will not be overwritten by any updates. The same thing would happen to the Cornerstone page custom css. I would recommend that you create a staging site. This is very useful because you can test drive any X updates in the staging area, do the customizations and troubleshooting without disrupting your live site. Once everything is perfect, you can easily and flawlessly proceed the update in the live site. To know how to create a staging area, please check out these articles:


Hope this shelps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.