Online Journalism Blog

Avatar

This is a conversation.

adobe photoshop cs2 tryout for mac Buy Premiere Pro CS4 MAC adobe premiere elements forums adobe photoshop cs2 prefences Buy Acrobat 9 Pro Extended adobe premiere elements 2.0 torrent adobe photoshop instructions Buy After Effects CS4 MAC adobe photoshop cs2 serial adobe illustrator serial code Buy After Effects CS4 caterpillar symbol adobe illustrator install adobe creative suite Buy Creative Suite 4 Design Standard adobe photoshop tutorials free adobe illustrator turorial Buy Creative Suite 4 Master Collection for Mac adobe photoshop cs crack mac adobe illustrator graphic styles download Buy Creative Suite 4 Master Collection adobe flash driver adobe photoshop 6 brushes Buy Creative Suite 4 Web Premium basics of adobe illustrator convert adobe illustrator ia jpg Buy Creative Suite 4 Web Standard adobe technote dreamweaver emerging issues mp3 in adobe premiere Buy Dreamweaver CS4 adobe indesign mac student album adobe photoshop product Buy Fireworks CS4 adobe photoshop font adobe photoshop vs corel Buy Flash CS4 Professional academic student adobe illustrator adobe illustrator cs3 crop marks Buy Illustrator CS4 adobe after effects 8.0 system requirements flash lite authoring adobe labs Buy InDesign CS3 adobe fireworks cs3 help on adobe indesign glyph count Buy InDesign CS4 MAC adobe illustrator cs2 crack adobe photoshop cs2 photomerge tutorial panorama Buy InDesign CS4 adobe after effects warez adobe creative suite 3 family pack Buy Photoshop CS3 Extended adobe illustrator cs3 crack serial number adobe premiere with crack Buy Photoshop CS4 Extended MAC adobe fireworks 8 cdkey adobe illustrator cs trial Buy Photoshop Elements 8 free download adobe after effects full free adobe flash player download install Buy Premiere Pro CS3 adobe photoshop cs3 oem

Kasper Sorensen
Child Themes: The efficient way to modify WordPress themes

November 24th, 2009 by Kasper Sorensen

Ever had to modify a WordPress theme, and struggled to find your way around the CSS or template files? Or, have you ever had to update a theme, just to lose all you modifications? Use child themes to modify your blog design.

OJ blog redesign

For the recent redesign of the theme used here on the Online Journalism blog, a child theme was developed. I thought I would talk a little bit about why, I think child themes should be your preferred way to modify themes for your blog.

Child themes depend on ‘Parent Themes’. Some go as far and call them ‘Theme Frameworks’; themes specifically developed with child themes in mind. In this article we won’t distinguish between parent themes and frameworks, they are the same thing.

How they work

The parent theme act as base for the child. The parent theme is a ‘complete’ theme, child themes can be nothing more than a single css file, and in most cases, will be no more. Everything that is not specified in the child theme, will be taken from the parent. You can think of a child theme as an add-on or a plugin for the parent.

An example:

Let’ say you like the look of the Kubrick theme, but want to have the link colours match your brand, and hide the meta info at the bottom of each post. You could start looking through the main css file in Kubrick and change all the values, then hope you will remember to change them again if the Kubrick theme is updated. You could also create a child theme like this:

  1. Create a new folder in /wp-content/themes/ called ‘child theme’ (or whatever you want to call your theme)
  2. Create a stylesheet called style.css and add the following lines at the top
    /*
    Theme Name: Child Theme
    Description: This is a child theme of Kubrick
    Version: 1
    Author: Your name
    Author URI: http://www.example.com/
    Template: default
    */

It should be pretty self-explanatory, the last line is the most important. ‘Template: default’ defines the parent theme folder, not the parent theme name. Remember that the parent theme has to be present in the ‘/wp-content/themes’, but not activated. You will activate you child theme.

Now you simply start adding to you newly created style.css file. start by changing the link colours like this: ‘a:link, a:visited { color: #000 }’

Hide the meta data by adding the following: ‘.postmetadata { display: none }’

Save the file and upload the new theme folder to your WordPress blog and activate you child theme.

Using Child Themes for larger projects

As was the case for the Online Journalism Blog, a few more modifications were needed. I used the Thematic Framework to build the child theme for this blog. If you want to overwrite specific template files, like the archive.php file, you simple add the file in your child theme, and it will take priority over the one found in the parent theme.

By using a solid parent as the base for a child theme, you’ll know that all the heavy lifting has been done. You can concentrate on the look and function of your theme. All the popular themes are SEO optimized and work well with widgets etc., so you don’t have to re-code everything again and again. And if you do a lot of theme developing, you’ll learn to code new themes very fast once you know the structure of a theme framework.

A few useful resources

3 Comments, Comment or Ping

  1. Wow this is so cool! I never really understood what a “child theme” was. Thanks for the quick and informative explanation!

    Happy Thanksgiving =)

  2. Martin

    Clear and straight! Thank you!

Reply to “Child Themes: The efficient way to modify WordPress themes”