Create a Child Theme to Customize a WordPress Theme

If you’re customizing a WordPress theme, it’s best to create a child theme out of the WordPress theme. With a child theme, you can update the parent theme when updates are available. Any customizations you make to the child theme will be retained.

Here’s how it works.

  1. If you’ll be creating a child theme for the Twenty Twelve theme (whose folder in wp-content/themes is “twentytwelve”), create a folder called twentytwelve-child and upload it to wp-content/themes.
  2. Create a style.css file and add this to it:Theme Name: Twentytwelve Child

    Description: Child theme for the twentytwelve theme
    Author: Your name here
    Template: twentytwelve
    @import url("../twentytwelve/style.css");

  3. In the Template field, change twentytwelve to whatever folder your parent theme is in. This field is the only really significant field up there.
  4. Change the Theme Name and any other details you want.
  5. For the @import url, change the URL to refer to your parent theme’s stylesheet. Then upload your style.css file to the twentytwelve-child folder.
  6. Activate your child theme by going to Appearance > Themes and select the Child theme. If you want a screenshot there as other themes display, add a screenshot.png file to your child theme folder. Now any changes you make to your child theme’s stylesheet will overwrite the parent theme’s styles. Additionally, any files you add, such as page.php or single.php, will overwrite the parent theme’s files. If you add a functions.php file, the functions.php file information will be added to the parent’s functions.php file rather than overwriting it.

When the parent theme gets updated, just apply the update to the parent folder and your child theme’s customizations will remain in tact.

Here’s a video showing the process:

See the Child Themes page on the WordPress Codex for more information.

Adobe RobohelpMadcap Flare

By Tom Johnson

I'm a technical writer working for the 41st Parameter in San Jose, California. I'm interested in topics related to technical writing, such as visual communication, API documentation, information architecture, web publishing, JavaScript, front-end design, content strategy, Jekyll, and more. Feel free to contact me with any questions.

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>