Protecting Customizations to WordPress Default

So, it’s time to install an important security upgrade. You back up your database, but forget to back up your customized version of a theme that comes with WordPress. When performing the upgrade, the new Default files overwrite the old ones, and your work on WordPress Default is lost.

There are two lessons here. The really obvious one is to back up everything before doing anything, but you might also want to look giving that customized Default theme a new home.

How To Start a New Theme

It’s very simple. Very quick. Very easy.

Step One: Back up your theme

Now that there is a copy sitting on your computer, you’re free to play.

Step Two: Add a new theme name to style.css

Open style.css with a text editor. At the top there is a list of information, between comment tags. Every theme must include a style.css, and the top of style.css must provide details about the theme in the form of comments. Some lines are required, some are optional. No two installed themes should have the same Theme Name.

Here is an example credits block:

/*
Theme Name: Theme Name
Theme URI: the-theme's-homepage
Description: a-brief-description
Author: your-name
Author URI: your-URI
Template: use-this-to-define-a-parent-theme--optional
Version: a-number--optional
.
General comments/License Statement if any.
.
*/

WordPress uses “Theme Name” to identify each theme in Presentation > Themes. Spaces and punctuation are fine. If your theme name is J@ne’Z Custom GiZmo BiZ, your Theme Name line might look like this:

Theme Name: J@ne'Z Custom GiZmo BiZ

Feel free to add your own information to the rest of the credits. When building on top of someone else’s work, it’s good form to leave some of their credits in place, at the very least in the general comments area.

Step Three: A new folder for a new theme

Change the folder name to something that fits your version of the theme. Purist that I am, for J@ne’Z Custom GiZmo BiZ I’d probably use a folder name like jane-gizmo. IMHO folder names (“directories” for us nerdy types) are best left plain jane. Avoid spaces or punctuation, and stick with lower case. Instead of spaces, use hyphens. The directory names my-theme or mary-theme is better than the directory names my theme or Mary's Theme.

  1. Upload your newly named folder to /wp-content/themes/ along with the rest of the themes
  2. Open Presentation > Themes, and voila, you’ll see your new theme name with the original Default screenshot.

Step Four: Add a screen shot

A screen shot is a nice touch, though not essential: the theme will still work without it.

Replace the file original WP Default theme’s screenshot.png in your theme dolder with your own screen shot of the same name and file type. Common screen shot size ranges from 200px to 500px at the widest point. File size is usually between 10kb and 50kb, though they can be found at over 100kb.

This entry was posted in Tools and Tutorials, Writing. Bookmark the permalink.

Comments are closed.