WordPress – Add a Child Theme to WordPress Default TwentyTwentyOne Theme

Are you using a visual page builder for your WordPress site such as Elementor, Divi, WPBakery etc? In that case, you will likely not have to touch your functions.php file or any line of code at all. However, have you tried searching how to do certain things for your website on Google, only to find a tip that advises to add some code to your functions.php? Perhaps you have gone in to Appearance > Themes > Editor > functions.php directly to add the line of code at the bottom, and it worked, which you are happy with.

However, if you do it that way, you’ll soon come to realise it is not sustainable, as the line of code will disappear when you update TwentyTwentyOne (which you should, whenever there are new updates).

Therefore, the best practice is to add a Child Theme. You can find out how to add Child themes via the WordPress Theme Developer Handbook. However, the theme TwentyTwentyOne is a bit unique and has a few more extra steps. This article is pertaining very specifically towards the WordPress default theme of TwentyTwentyOne only. If you are using other themes, we recommend that you refer to the WordPress Handbook instead.

If you’re using the TwentyTwentyOne theme and you wish to use a child theme, there are just 3 steps involved.

Step 1: Create style.css for the Child Theme (You may copy our code)

Step 2: Create functions.php for the Child Theme (You may copy our code)

Step 3: Package both files into a folder called twentytwentyonechild, and place it into your themes folder

Step 4: Activate the theme

Afterwards, you are done. You will be able to go into functions.php of the child theme and add whatever codes you need to, and even after updating the main TwentyTwentyOne theme, your codes will stay.

You may also choose to add a theme preview image if you want to — just add a screenshot.png into the child theme folder.

Unsure of where to insert this? Don’t want to break anything? Our team of WordPress developers in Singapore can accomplish this job for you safely and efficiently. We are highly experienced in WordPress and web development and are equipped in solving any issues you might be facing.

oangledes

Recent Posts

Turning Website Visitors Into Loyal Customers

Discover how thoughtful web design and user experience strategies can transform first-time visitors into loyal…

7 days ago

Building Trust Through Modern Website Design

Trust is a critical factor in online conversions. Learn how modern website design builds credibility…

2 weeks ago

Crafting High-Impact Landing Pages That Drive Results

Landing pages are designed for one purpose: conversion. Learn how to craft focused, impactful landing…

2 weeks ago

The Hidden Power of White Space in Web Design

White space is often mistaken for empty space, but in web design it plays a…

4 weeks ago

Designing Digital Experiences That Convert in Seconds

Users today decide within seconds whether a website deserves their attention. Designing digital experiences that…

1 month ago

High-Fidelity vs Low-Fidelity Prototypes: When To Use Which

Prototyping is an essential step in UX design, but not all serve the same purpose.…

1 month ago