Child Themes Helper
The Child Themes Helper plugin was developed to solve a problem that I was struggling with: the copying of files from a template theme to a child theme. It was almost never easy.
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 plugin solves the above problem with a nice elegant solution. The files in the child theme and the files in the template theme are displayed on the screen using a pair of CSS Grid boxes (child theme is listed on the left and template theme is listed on the right). The developer only needs to click on the file from the template theme and viola! the file is immediately copied to the child theme and all of the subfolders in the path are perfectly duplicated in the child theme.
But what good would a plugin be, which let you easily copy files from the template theme to the child theme, if you couldn’t delete those copied files when the need arose. Well, the Child Theme Helper plugin lets you do just that. Simply click on any file from the child theme file list and poof, the file is removed from the child theme.
But wait. Isn’t that an awful lot of unchecked power? Yes it is. Before a file is copied from the template theme to the child theme, or removed from the child theme, the Child Theme Helper plugin will verify that the file in the child theme hasn’t been modified. If it has been modified (i.e., it’s not identical to the same file in the template theme), then instead of that instant copy, you’ll get a popup message telling you that the files are different, warning you that you will lose your changes, and asking you if you want to continue and overwrite (copying from the template to the child) or delete (removing from the child) the child theme file. You still have the power to delete or overwrite your modified file, but you have to take the extra step and verify that you really want to proceed.
Further, the Child Theme Helper plugin refuses any and all requests to overwrite or remove the style.css and/or the functions.php file. I don’t want to be blamed because you destroyed your active theme and thus your website because you used the Child Theme Helper plugin to destroy your theme. So, you cannot delete or overwrite your style.css or functions.php files. If you really must do that, I suggest that you use your favorite FTP client.
The Child Theme Helper plugin only manipulates the child theme files. The template theme is never touched. A new feature that is currently planned, but not yet implemented, is the ability to edit the files for a quick peek or a quick modification. Once that feature has been completed, the developer will be able to open the template theme files, but they will not be able to save any modifications. Only changes to the child theme files may be saved.
Starting with version 1.3.2, you can edit child theme files directly, and save your changes. You can open parent theme files in an editor, but parent theme files are read-only. If you make changes to a parent theme file, you will not be able to save theme.
The Child Theme Helper plugin was intended for one purpose: to copy files to the child theme. But what should it do when the currently active theme isn’t a child theme? My first thought was to disable it somehow. But then I thought, why not give the developer the opportunity to create a new child theme.
When the currently active theme is not a child theme, the Child Theme Helper plugin will prompt you (on it’s dashboard page) to create a new child theme for any theme that you have installed, whether it’s the active theme or not, with the exception of other child themes. WordPress doesn’t allow a child theme to use another child theme as its template theme. Once the new child theme has been created, you are redirected to the website’s Themes page on the dashboard. The new child theme IS NOT activated by the Child Theme Helper plugin, although it is ready to be activated.
When the Child Theme Helper plugin creates a new theme, it does three things: