Child themes are WordPress themes that inherit functionality from other WordPress themes. Many administrators create child themes for their current theme so they can safely customize their site design without losing pre-update settings when the theme is updated.
![Image[1]-How to create WordPress sub-themes (Beginner's Guide) - Photon Fluctuation Network | Professional WordPress Repair Service, Global Reach, Fast Response](https://www.361sale.com/wp-content/uploads/2024/09/2024090410334983.jpg)
How does the child theme work? Why is it needed?
A child theme inherits all the features, functionality and styles of another WordPress theme. When creating a child theme, the original theme is called the parent theme.
Inheritance consists of the parent theme's style.css file, which defines the theme's main styles. Child themes can override or extend their inherited properties by adding their own files or modifying existing files.
While it is possible to customize a WordPress theme without installing a child theme, a child theme may still be needed for several reasons:
- Child themes protect custom settings from being overwritten during theme updates. If the parent theme is modified directly, then these tweaks may be lost during the update.
- A child theme can safely experiment with new designs or features without messing up the original theme of the site, similar to a staging environment.
- Child themes can make the development process more efficient if you know how to code. The documentation of a child theme is much simpler than that of the parent theme. It is possible to focus on modifying only the parts of the parent theme that you want to change or extend.
What to do before creating a WordPress child theme
We see a lot of WordPress users researching technical content, but when an error occurs it's more of a headache. We understand this feeling because we've encountered it too. That's why it's important to know what to expect before creating a child theme.
Here are a few things we recommend doing before continuing with the guide:
- Note the use of code. At a minimum, a basic understanding of HTML, CSS, PHP, and JavaScript (optional) is required to understand what changes need to be made. This can be done in theWordPress Theme ManualRead more about it in.
- Choose a parent theme that has the desired site design and functionality. If possible, find a theme that requires only a few changes.
- Use a local site or experimental site for theme development.
- Very important step to back up your website's data.
There are multiple ways to create child themes from existing themes. One is to use manual code and the other requires a plugin, which is more newbie friendly.
The first method may seem daunting if one lacks technical experience. That said, even if one chooses one of thesePlug-in methodWe recommend thatReading manual methodsto familiarize themselves with the process and the documentation involved.
Method 1: Create a child classic theme using a plugin
One of the best ways for newbies to useChild Theme ConfiguratorPlugin. This WordPress plugin allows you to quickly create and customize WordPress child themes without using code, but it only works with classic (non-block) themes.
Start by installing and activating the WordPress plugin. Once activated, navigate in your WordPress dashboard to the"Tools" ""Subtopics"".
In "Father/child" tab, the system will ask to select an action. Simply select "Create new subtopic" to get started.
![Image[2]-How to create WordPress sub-themes (Beginner's Guide) - Photon Fluctuation Network | Professional WordPress Repair Service, Global Reach, Fast Response](https://www.361sale.com/wp-content/uploads/2024/09/2024090410051146.png)
Then, select a parent theme from the drop-down menu. We choose the Hestia theme.
After that, just click "analyze" button will ensure that the theme is suitable for use as a parent theme.
![Image[3]-How to create WordPress sub-themes (Beginner's Guide) - Photon Fluctuation Network | Professional WordPress Repair Service, Global Reach, Fast Response](https://www.361sale.com/wp-content/uploads/2024/09/2024090410054282.png)
Next, the system will ask to name the folder where the sub-theme will be saved. Any customized folder name can be used.
Below, you need to choose where to save the new style: in the main stylesheet or in a separate stylesheet.
The master stylesheet is the default stylesheet that comes with the child theme. Saving a new custom style to this file will directly modify the master style of the child theme. Each modification will overwrite the original theme's style.
The separate option allows saving new custom styles to a separate stylesheet file. This is useful if you want to keep the original theme style without overwriting it.
For demo purposes, we will select the first option. However, feel free to repeat this process and select the second option as you get more creative with your child theme customizations.
![Image[4]-How to create WordPress sub-themes (Beginner's Guide) - Photon Fluctuation Network | Professional WordPress Repair Service, Global Reach, Fast Response](https://www.361sale.com/wp-content/uploads/2024/09/2024090410072392.png)
Moving down the list, you must select how to access the parent theme's stylesheet.
We use the default "Using the WordPress Style Queue", as it will let the plugin automatically determine the appropriate action.
![Image[5]-How to create WordPress sub-themes (Beginner's Guide) - Photon Fluctuation Network | Professional WordPress Repair Service, Global Reach, Fast Response](https://www.361sale.com/wp-content/uploads/2024/09/2024090410075161.png)
When you get to step 7, you need to click on the button labeled "Click to edit sub-topic properties" button.
You can then fill in the details of the subtopic.
![Image [6] - How to create WordPress child theme (Beginner's Guide) - Photon Fluctuation Network | Professional WordPress Repair Service, Global Reach, Fast Response](https://www.361sale.com/wp-content/uploads/2024/09/2024090410084078.png)
When creating a child theme manually, menus and widgets from the parent theme are lost. The child theme configurator can copy them from the parent theme to the child theme. If you want to do this, check the checkbox in step 8.
Finally, click "Create new subtopic" button to create a new child theme.
![Image [7] - How to create WordPress child theme (Beginner's Guide) - Photon Fluctuation Network | Professional WordPress Repair Service, Global Reach, Fast Response](https://www.361sale.com/wp-content/uploads/2024/09/2024090410100684.png)
The plugin creates a folder for the child theme and adds style.css and functions.php files that will later be used to customize the theme.
Before activating the theme, you should preview it by clicking on the link near the top of the screen, it looks good and doesn't trigger other issues with the site.
![Image[8]-How to create WordPress sub-themes (Beginner's Guide) - Photon Fluctuation Network | Professional WordPress Repair Service, Global Reach, Fast Response](https://www.361sale.com/wp-content/uploads/2024/09/2024090410111635.png)
If all is well, click "Activate and publish"Button.
Now the child theme will go live.
At this stage, the child theme looks and functions exactly like the parent theme.
![Image [9] - How to create WordPress child theme (Beginner's Guide) - Photon Fluctuation Network | Professional WordPress Repair Service, Global Reach, Fast Response](https://www.361sale.com/wp-content/uploads/2024/09/2024090410122422.png)
Method 2: Create a sub-block theme using a plugin
If using a block theme, then WordPress provides an easy way to create child themes using the Create Block Theme plugin.
First, install and activate the WordPress plugin. After that, go toAppearance" creates a block theme.
Here, simply select "Create a child theme of [theme name]". We'll use Twenty Twenty-Four in this example.
After selecting this option, fill in the information for the subject.
![Image [10]-How to create WordPress sub-themes (Beginner's Guide) - Photonflux.com | Professional WordPress Repair Service, Global Reach, Fast Response](https://www.361sale.com/wp-content/uploads/2024/09/2024090410270289.png)
Below, more things can be done such as uploading screenshots of the theme to differentiate it from others, adding image sources, linking to must-have WordPress plugins, adding theme tags, and more.
After completing the configuration settings, simply scroll all the way down and click "generating"Button.
![Image [11]-How to create WordPress sub-themes (Beginner's Guide) - Photon Fluctuation Network | Professional WordPress Repair Service, Global Reach, Fast Response](https://www.361sale.com/wp-content/uploads/2024/09/2024090410274933.png)
The plugin will now create and download a new child theme zip file to your computer.
If you open it, you will see three files:readme, style.css respond in singingtheme.jsonThe
The theme.json file defines all aspects of a block theme, including its colors, fonts, layout, etc. The theme.json file is used to define the style of the block theme. The plugin creates this file by default so that you can later override or extend the parent theme's styles in child themes.
At this stage, the next thing to do is to move to theAppearance" themeThe
After that, click "Add new topic "The
![Image [12]-How to create WordPress sub-themes (Beginner's Guide) - Photon Fluctuation Network | Professional WordPress Repair Service, Global Reach, Fast Response](https://www.361sale.com/wp-content/uploads/2024/09/2024090410292191.png)
Next, select "Upload a topic".
Then, select the zip file and click "Installation" to install the WordPress theme.
![Image [13]-How to create WordPress sub-themes (Beginner's Guide) - Photonflux.com | Professional WordPress Repair Service, Global Reach, Fast Response](https://www.361sale.com/wp-content/uploads/2024/09/2024090410300269.png)
Link to this article:https://www.361sale.com/en/18790
The article is copyrighted and must be reproduced with attribution.
No comments