Basic WordPress Child Themes

With the new version of WordPress came a new default theme complete with a number of powerful features including easy custom backgrounds, header images and user-definable navigation menus. I was immediately drawn to the features but found the visual look itself a little wanting.

I was interested in using the advanced features of Twenty-Ten, particularly the custom backgrounds, but also wanted something better looking without having to create my own from scratch. Luckily there was a another new feature released for just that purpose.

Child Themes

In WordPress, even themes have different versions, the default has been updated multiple times since it’s release. A child theme let’s you override just the parts of a theme that you want to change without having to change the actual theme files. When an update is released, rather than having to make your changes again, your child theme is untouched, leaving your changes to cover the new files instead.

A child theme only needs two things: it’s own folder and css file. The css file contains the same header information as regular themes with one important addition.

/*
Theme Name: Twenty Ten Child
Theme URI: http: //example.com/
Description: Child theme for the Twenty Ten theme
Author: Your name here
Author URI: http: //example.com/about/
Template: twentyten
Version: 0.1.0
*/

The template line refers to the folder of the parent theme, telling WordPress to use it for the files that aren’t defined in the child theme. The parent’s css file is not loaded by default so if you just want to override a few things instead of writing an entire file, you’ll need to import the parent’s css file into the child’s then overwrite anything you don’t like.

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

This is where the finicky part comes in, dissecting someone else’s stylesheet and html to find the exact selectors and definitions you need to override. No matter how thoroughly documented something is, the sheer fact it’s not set out the way you would have done it makes it harder to figure out.

I tried to use the same headings and arrangement, only overriding what I wanted to change. I made the effort to make as few changes as possible to achieve the results I wanted. Hopefully this will make it easier to update Trans Twenty Ten to keep up with the parent theme Twenty Ten as it evolves.

Laura specializes in small businesses and non-profits, working one on one, giving them websites to help them fulfill their dreams.

« § »

One thought on “Basic WordPress Child Themes

  1. Pingback: The Creative Librarian » Scholarly Articles on Wordpress

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>