Child Themes Helper

The Child Themes Helper makes it easy to copy files from any folder in the parent theme to the identical folder in the child theme. The user only needs to right click (or secondary mouse button, or long press on smartphone or tablet) on the parent file that they want to copy. A popup menu will appear where they can choose to Copy the file to the Child theme or View the file’s contents. Also, if the file already exists in the child theme and if it is not identical to the one being copied, they will be prompted to verify that they want to overwrite the file. Then the Child Themes Helper plugin will copy their selected file from the parent theme to the child theme and duplicate the folder path  and if it already exists in the child theme and is not identical to the file in the parent theme, they will be prompted to overwrite the file.

The current version of the Child Themes Helper plugin for WordPress may be downloaded here:

Version 1.0 was released on August 17, 2018. The most recent update, version 2.2.4, on Nov 11, 2021, supports PHP 8.0 and WordPress 5.8.2. The Child Themes Helper should function correctly on any web server running PHP 5.7 and beyond and WordPress 4.7 and beyond.

Before we get into the details of the all of the Child Themes Helper functionality, let’s define some terms that will be used to describe the functionality of this plugin.

Theme

According to the WordPress Codex, a theme is “a collection of files that work together to produce a graphical interface with an underlying unifying design for a weblog. These files are called template files. A Theme modifies the way the site is displayed, without modifying the underlying software.”

Child Theme

Back to the WordPress Codex:  “A child theme is a theme that inherits the functionality and styling of another theme, called the parent theme or the template theme. Child themes are the recommended way of modifying an existing theme.

Parent Theme

The parent theme is the WordPress name given to the theme from which you derive a child theme.

Template Theme

The Template Theme and the Parent Theme are the same thing. Most users refer to the template theme as the parent theme. But the WordPress codex refers to the parent theme as the template theme.

Panes

The Child Themes Helper plugin uses vertical panes to display the files associated with each theme. The child theme’s files are listed in the left-hand pane and the parent theme’s files are listed in the right-hand pane. The terms used in this write-up are the child theme pane, and the parent theme pane or the template theme pane.

Description

  1. Copy files from Parent Theme to Child Theme
    The primary purpose of the Child Themes Helper plugin is to copy files from a parent theme (also called the template theme) to a child theme. The folder path in the parent theme is duplicated in the child theme during the copy.

  2. Remove files from the Child Theme
    The Child Themes Helper plugin will also remove any files that you no longer want in the child theme. Any folders that are made empty by the removal of a file or folder, will also be removed.

  3. Prompt before removal
    The Child Themes Helper plugin will detect when a child theme file is different from its parent theme counterpart. If the files are not identical, the user will be prompted before allowing a parent theme file to be copied over an existing child theme file, or before allowing a child theme file to be removed.

  4. Create a child theme
    The primary functionality of the Child Themes Helper plugin requires the existence of a child theme. If a child theme has not already been created, this plugin will help you to create a child theme of any of the currently installed themes (not other child themes) on the website.

  5. Generate a temporary graphic for the Themes page
    Creating a child theme does not create a graphic for your new theme on the WordPress themes page. The Child Themes Helper plugin can create a graphic for your child theme. You’re free to select the foreground and background colors for that graphic and choose from up to a couple of dozen Google Fonts. If you would like a different font, you only need to copy the .ttf file into the Child Themes Helper plugin’s assets/fonts folder. The next time you open the Options page, the newly downloaded font will be displayed with a sample string.

  6. Notes

    • Screenshot
      The temporary graphic is referred to as the ScreenShot because the filename is “screenshot.png” and is located in the root folder of your theme. The filename and the location are defined by the WordPress core and cannot be changed by this (or any) plugin.

      Your browser will cache the screenshot file whenever possible. If you modify the ScreenShot graphic and you do not see any changes when you generate a new one, then you will need to clear your browser’s image and file cache.

      If you generate a screenshot graphic and you only see the background (i.e., no words), just generate the screenshot again. This happens when the selected font does not exist in the assets/fonts folder of the Child Themes Helper plugin. If you are updating from version 1.0, you will see this happen the first time that you generate a screenshot since the original fonts were deleted and replaced by Google Fonts.

      Most developers will replace this generated screenshot file with a graphic of their own. This feature is meant to provide a temporary graphic that quickly and easily identifies the child theme name and its parent theme.

      In a future release, there will be a lock feature on the options page to prevent accidental overwrites of the screenshot file. Also, in a future release, there will be the ability to select an existing graphic and crop it as necessary, instead of generating one.

    • Child Themes Helper access
      The Child Themes Helper is accessed from the WordPress dashboard under the heading “Child Themes Helper”. It is located immediately below the Appearance Dashboard menu item.

    • Platform Support
      The Child Themes Helper plugin has been tested with both WordPress running on a Windows server and with WordPress running on a Linux server. Development is done on a Windows platform. If you find any compatibility issues with Linux, please let me know.

    • Child Themes Helper plugin code
      The GitHub repository for this plugin can be found here.

    • Development versions
      Versions 1.2, 1.1.3 and 1.0 are available for download and install.

© 2018 – 2021, PaulSwarthout. All rights reserved.