We get asked for help with Child Themes with surprising regularity. In fact, we know some pretty well-versed WordPress users and even consultants who have very basic questions about this very basic topic. So let’s take a quick pass at WordPress Child Themes and especially at WordPress Child Theme Requirements.
What you see here is all that’s required for a WordPress Child Theme. In fact, this is more than you actually need to get a child theme running most of the time; nowhere in the rules for WordPress Child Theme Requirements will you find functions.php; the only requirements are a style.css file, and an image.
And the image is only used internally; you could put a picture of your favorite supermodel in there.
The reason you use a Child Theme in WordPress is to make sure any changes you make to a theme don’t get overwritten as new versions of your theme are installed. That means that if you aren’t getting updates, say, in the case of themes that have become obsolete, or if you commission a custom theme and there are no updates, technically you don’t need a child theme at all. That said, using a child is simply a good idea; call it a matter of best practices.
At WP Solver, they’ve just turned us on to a plug-in called Child Theme Configurator. We used Child Theme Configurator to build the Child theme shown by those three files; it works perfectly. The question is, do you need it?
Remember that you don’t have to use a child functions.php file, and that using functions.php is a slightly more advanced topic than most of what goes into creating a basic child theme. Remember also that the contents of your picture file are only for your eyes and only used so you can have a visual handle on a theme when you select it inside WordPress.
So, ready? Here’s the total content in style.css when you start a child theme:
/* Theme Name: The WordPress Helpers Child Theme Theme URI: http://wordpress.answerguy.com/ Version: 1.0 Description: Child Theme for The WordPress Helpers Author: The Answer Guy talks WordPress Child Theme Requirements Author URI: http://www.answerguy.com Template:TheWordPressHelpers */ @import url("../TheWordPressHelpers/style.css");
Note that everything except the last line, where you begin by importing the style.css from your parent theme, is just comment code. In other words, as with your picture file to help you “see the theme”, almost the entirety of a child theme’s only required working file—and what Child Theme Configurator creates— is fluff. Seriously, just copy what you see here!
And the only functional part of the new child theme’s style.css is using a template name that matches the parent theme’s name.
So you don’t need Child Theme Configurator unless you’re just … lazy!
That said … laziness has its place in the world, if not in the world of WordPress Child Theme Requirements. Rock on … just please make sure that no matter how you choose to create it you use a child theme.
Pingback: The WordPress Helpers WordPress Roundup 29-Jan-2015 - The WordPress Helpers
Pingback: WP Designer: Own Your Themes, Functions, and CSS - The WordPress Helpers