Child Themes Helper

Description

The Child Themes Helper plugin was developed to solve a problem that I was struggling with: Copying files from a template theme to a child theme. It was almost never easy.

The basic steps are simple enough:

  1. Duplicate the template theme folder path to the file you want to copy into the child theme.
  2. Copy the specific file to the child theme. Often this requires copying the file to a neutral location, and then copying it back to the child theme.

Invariably, I would misspell a folder name, or skip a hyphen or underscore, or in the case of multiple subfolders, I would simply miss creating one of the subfolders. But I would not notice until I was attempting to see the results of my changes. Then I would waste a lot of time trying to figure out what I did wrong. Was it a problem with the stylesheet? Was it a problem with how I included the style.css file? Is there a problem with ‘functions.php’? Or was the modified file just in the wrong place so the template theme’s file was used instead?

There has to be a better way. I looked around and didn’t really find one. So, being a programmer at heart, I wrote one. In fact, I wrote THIS one.

The Child Themes Helper is an elegant solution to the above problem. The primary features are discussed in more detail below.

Copy files from Template Theme to Child Theme

When your currently active theme is a child theme, the Child Themes Helper displays two vertical panes on a dashboard page. The left-hand pane shows a complete listing of the child theme’s files. The right-hand pane shows a complete listing of the template theme’s files. You can click on most any file from the template theme to copy it to the child theme. The folder path to the file is duplicated in the child theme and then the file is copied. Every theme, regardless of whether or not it is a child theme, has a ‘style.css’ file and a ‘functions.php’ file that define the theme. The Child Themes Helper will not overwrite the ‘style.css’ or the ‘functions.php’ files in the child theme.

Additionally, the Child Themes Helper looks an existing file in the child theme before blindly overwriting the file. If the file exists, and it’s not identical to the file you are attempting to copy, then you will be prompted to verify that you really do want to overwrite that file.

But what if you accidentally copy the wrong file? You would just click on the file in the child theme that you no longer want in the child theme and, as long as, it was identical to the template file, it will be removed. If the file is not identical, then you will be prompted to verify that you really do want to delete that file.

The Child Themes Helper plugin is meant to help developers with copying files from the template theme to the child theme. The plugin does not modify or remove any files from the template theme.

Create a New Child Theme

When your currently active theme is not a child theme, the Child Themes Helper will help you to create a child theme. The plugin creates a bare ‘style.css’ file with the header filled out so that WordPress recognizes it as a child theme, and a ‘functions.php’ file that correctly includes the ‘style.css’ file into the child theme. You can choose to make a child theme from any non-child theme that is installed in your WordPress site. Once the Child Themes Helper has finished, you are free to Activate your new Child Theme. Once activated, you will see the familiar Child Themes Helper interface for copying files from the template theme to the child theme when you visit the Child Themes Helper dashboard page.

Create a ScreenShot for your Child Theme

Brand new child themes are displayed on the themes dashboard page lacking an identifiable graphic until you modify your child theme and create one. But the Child Themes Helper will create one for you that shows the name of the child theme, the name of the template theme, and a statement about having been created by the Child Themes Helper and the web address for its developer.

It’s not meant to be pretty. It’s meant to be informational, and strictly temporary. It is expected that you will eventually replace that screenshot.png file with your site’s header image, or some other identifying graphic.

Child Themes Helper access

The Child Themes Helper functionality is accessed from the WordPress dashboard under the heading “Child Themes Helper”.

Screenshots

  • The files for the Child Theme are displayed in the left-hand pane. The name, 'MyChildTheme' for example is the name of your Child Theme. The page scrolls.
  • The files for the Template Theme, or the Child Theme's parent theme, are displayed in the right-hand pane. For this example, the Child Theme was created as a child of the 'Twenty Sixteen' theme and it's name appears at the top. The page scrolls.

Installation

  1. Upload the plugin files to the /wp-content/plugins/pasChildThemes directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the ‘Plugins’ screen in WordPress
  3. There are no settings that need to be manipulated prior to using the Child Themes Helper. You will not able to effect changes to a template theme — only child themes, and only if it’s already marked as activated.

FAQ

Installation Instructions
  1. Upload the plugin files to the /wp-content/plugins/pasChildThemes directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the ‘Plugins’ screen in WordPress
  3. There are no settings that need to be manipulated prior to using the Child Themes Helper. You will not able to effect changes to a template theme — only child themes, and only if it’s already marked as activated.

Contributors & Developers

“Child Themes Helper” is open source software. The following people have contributed to this plugin.

Contributors

Translate “Child Themes Helper” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Changelog

1.0

First public release