CHAPTER 4

USING CHILD THEMES

SO YOU THINK you know all you need to know about theming to get your hands dirty, eh? In a way you do. Now you can hack away at just about any theme, which you did in Part I; but, there is more to it still.

Theme design is comprised of many elements. You've got your template tags, conditional tags, custom post types and taxonomies, custom backgrounds and headers, widget areas, and so on.

These things are cool, and important for the theme designer to know. A veritable key to the themes universe, as well as to a beautiful and feature-rich WordPress site.

But what is often overlooked, and ironically the most important thing that can save you time and headaches, are child themes. If you want to design a WordPress theme by altering an existing one, you can take it to the next level with a child theme.

THE CHILD THEME CONCEPT

As the name implies, child themes rely on another theme that serves as a parent for the child. The child theme borrows everything from the parent, unless the child theme contains the necessary code itself. So in other words, if your child theme has a single.php template file, it'll use that, but if it doesn't, it'll use the one from the parent theme.

WHY ARE CHILD THEMES SO GREAT?

First of all, it depends on what you're trying to do. Child themes are not always the solution, especially if you're looking at heavyweight sites with tons of visitors and every byte counts, and costs money. Since a child theme often overrides parts of its ...

Get SMASHING: WordPress Themes: MAKING WORDPRESS BEAUTIFUL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.