Site icon Mostly Harmless

Coraline child theme

Have I mentioned how easy it is to use WordPress child themes? I can’t stress it enough, never modify a WordPress theme. Create a child theme instead.

I just converted a blog from an old outdated Cutline theme to a SVN copy of Coraline.  This is the WordPress.COM replacement for the Cutline theme.  The old theme bugged me for a few reasons, mainly it was the lack of basic features such as Gravatar support. I had meant to clean it up but never got around to it.

It took me less than an hour to make the switch. I retrieved a copy of Coraline like so

$ cd wp-content/themes
$ svn co http://svn.automattic.com/wpcom-themes/coraline coraline

This keeps an unmodified copy of the Coraline theme.  Once it’s in the WordPress.ORG website, I’ll replace it with that copy.

All I had to do was create a separate directory and create a style.css file with the following:

/**
 * Theme Name: Coraline for Stefan's Stuff
 * Description: Jan Dembowski's Coraline Child Theme
 * Version: 1.0
 * Template: coraline
 */

@import url("../coraline/style.css");

/* =Asides
---------------- */

.home #content .aside {
 border-left: 1px solid red;
}

The old asides had a slightly different styling.  I made copies of the header.php and footer.php files into my child theme directory and added an archives.php template. I modified one line in each of the copies.

I tossed in a rotate.php script and copies of the random banner images and I was all set. I did need to resize the old banner images from a width of 970 to 990 but that was it.

Child Themes are cool and once again I can keep the parent theme up to date without worrying about my changes.

Exit mobile version