Kajal Dhameliya
Forum Replies Created
-
Hi Leah,
The process of developing a child theme for a block theme (modern theme) is similar to creating a child theme for a classic theme(traditional theme). However, if you prefer a more modern approach, you can follow these resources for guidance:
- How to Create a Block Child Theme in WordPress (GoDaddy)
- Child Themes for Full Site Editing (FullSiteEditing.com)
- Create the
style.css
file: Include the theme header information such as the theme name, text domain, and template name. This structure is similar to classic themes. - Copy and modify the
theme.json
file: Update it to customize settings like colors, spacing, layout, typography, and more. This is a modern way to define styles and settings for block themes. - Default CSS in
style.css
:If you have traditional CSS styles, you can add them to thestyle.css
file in the child theme. These styles will be applied, just like in classic themes.
Let me know if you need further assistance!
Hello Leah,
Unlike traditional themes, block themes do not useheader.php
files for their<head>
structure. Instead, the<head>
is implicit and dynamically generated when WordPress renders the page.
Block themes still rely on thewp_head()
function to insert these elements into the page. Thewp_head()
call is typically included in the theme’stheme.json
or indirectly added through WordPress itself.
If you want to add custom elements to the<head>
(like meta tags or custom scripts), you can do so usingwp_head()
hook in your theme’sfunctions.php
.