Make Your WordPress Theme Tweaks Sticky

Ever get annoyed that your beloved theme changes disappear every time you update?

Everybody does.

Most people end up doing the same old copy/paste routine every time, but that gets old after a while.

Fortunately, there's a way of making the modifications permanent.

Create a New CSS File

The only thing you're going to need for this exercise is a new style sheet, so create a file somewhere and name it style.css.

If you're using a WordPress theme (not Genesis), add the following header text to the new file:

Theme Name: My Tweaks
Template: flaky-theme
@import url("../flaky-theme/style.css");
/* *** customizations below *** */

You'll need to replace flaky-theme with the directory name of the theme you're overriding. For instance, the above example would be fine if that was in wp-content/themes/flaky-theme/, but yours probably isn't, so adjust accordingly.

With either type of theme, WordPress or Genesis, add your custom CSS code to the bottom of that file.

The only difference between the WordPress and Genesis versions is that WordPress users will have a header at the top of their CSS. Genesis users won't.

Create a WordPress Child Theme

If you're using Genesis, skip down to the Genesis section. These instructions won't work for you. For the rest of you, creating a bare-bones child theme isn't nearly as hard as it sounds, so don't worry.

On your server, create a directory to house your new child. Under wp-content/themes, create a directory named my-tweaks.

Place a copy of the new style.css file inside that directory. You should end up with a wp-content/themes/my-tweaks/style.css file containing your custom code.

As a final touch, to avoid an esthetic problem later, copy the screenshot.png file from your original theme's directory into the new child directory.

You should then have a wp-content/themes/my-tweaks/screenshot.png file.

All that's left is to activate your new child theme in the WordPress dashboard.

For Genesis Themes Only

For Genesis themes, the solution is really simple.

Place your new style.css file on your server in wp-content/themes, so you should end up with a wp-content/themes/style.css file.

Now go back to your WordPress dashboard. Under the Genesis Settings, scroll all the way down to Header Scripts.

Inside the box, add the following text:

<link rel="stylesheet" type="text/css" href="/wp-content/themes/style.css" />

That's it. You can save the configuration and close the dashboard.

The one big drawback to this method is that you won't be able to edit your new CSS file in the WordPress editor. Hopefully, you've already ironed all the bugs out.

Check It Out

That's all there is to it.

Go back to your site and make sure everything is working like it's supposed to.

If all is well, you can sleep easy at night knowing you'll not have to worry about re-customizing every time you update. And, you won't be nearly as apt to skip updates.