In front of usThe cases used inside the article are classic themes, this installment of the tutorial was created using a block theme. If using a block theme, then WordPress provides an easy way to create child themes using the Create Block Theme plugin.
First, you need to install and activate the WordPress plugin. After that, go toAppearance" creates a block theme.
Here, simply select "Create a child topic of [current topic name]"The
Next, fill in the information for the child theme. We're using Twenty Twenty-Four in this example, so we'll name it Twenty Twenty-Four Child.
After filling in the description and author on the subtopic. Click "Creating subtopics"Button.
The plugin will now create andInstalling WordPress Themeszip file to the admin area.
Upon completion, the site will automatically activate this newly created child theme. This can be done by going to"Appearance" ""Subject""to confirm.
How to customize the block subtheme
The sub-block theme has already been created, and if a sub-block theme is used, most of the customization will be done in the theme.json file, not style.css.
During testing, we found the process to be complicated. Unlike classic child themes, if you are new to WordPress theme development, you need to recharge your batteries (especially regarding JSON and how CSS is handled there).
However, we've found that using the Create Block Theme plugin is an easier alternative. This tool records any changes made in the WordPress full site editor in a sub theme.json file. Therefore, there is no need to touch any code at all as the plugin will take care of it.
To show you an example. First, by going to theThe "Appearance" editor opensWordPress full site editor.
Several selectable menus can be seen.
Here, simply select "type"Just do it.
On the next page, you will see several built-in style combinations to choose from.
You can just skip all that and click on the pencil icon.
Now, let's try to change some parts of the child theme, such as the font.
For this example, go ahead and click the "typographical".
Next, you will see some options for changing the theme of theText, links, titles, headingscap (a poem)buttonsof the global font.
To demonstrate the case, we click on "caption".
In the Font drop-down menu, change the original selection to any available font.
Feel free to change the appearance, line height, letter spacing, and letter case if needed.
When you're done, simply click "save (a file etc) (computing)". After that, you can click "Save"Next to it."Creating Block Topics" button (wrench icon).
Then, click on "Save theme changes".
Next, go ahead and select the changes you want to save to the child theme.
Examples include fonts, custom styles, template changes, and more.
When you're done, just scroll all the way down the sidebar.
Then, click on "Save Changes".
Now, look at the theme.json file to see the changes reflected in the code.
Click again."Creating Block Topics"button and select the "View topic.json".
After clicking on it, you will see that the file contains some new code additions.
In our example, the file contains code indicating that the title tag will use a semi-bold appearance, 1.2x line height, 1-pixel line spacing, and a lowercase Inter font.