Tip:
Highlight text to annotate it
X
In this video we'll go over how to create a WordPress child theme.
You'll need a code editor such as Notepad on the PC or TextMate on the Mac. You'll also
need an FTP program, set up so that it connects to the server where your website is hosted.
A good FTP program which can be downloaded for free is Filezilla. Documentation for its
use is available on the same website. Or, if your web host provides you with cPanel,
you can use its File Manager to upload files. Read the cPanel documentation for specific
directions. The first step is to create a child theme
folder. On your local hard drive, navigate to the folder where the WordPress files are.
Click to find and open the wp-content/themes folder.
Inside, you should see a folder for each theme which is currently installed, including any inactive
themes. Alongside the other theme folders, create
a new empty folder, and give it the name you'd like to call your child theme. You can name
it anything you want, but when naming the folder, don't include spaces or special characters
other than hyphens or underscores.
Now open your code editor. Create a new blank text file, save it into your new child theme
folder, and name it style.css. It has to have that exact name. Keep this file open for editing.
Point a web browser to the address you see here, where you'll find a block of code. Copy
this code block. Switch back to style.css, carefully paste in the code, and save.
This code uses placeholder text which you now need to replace with your own.
Replace the existing text Your Child Theme Name with the name you're giving your child
theme. In this location, it can have spaces, because it's used as a label on the Admin
Screens. But of course you'll want it to be very similar to the name you gave the child
theme folder. Replace the existing text exact_parent_theme_folder_name
with the precise name of the folder which contains your parent theme. Be aware that
uppercase vs. lowercase matters here. On the line which begins with @import url,
again, replace exact_parent_theme_folder_name with your own parent theme folder name.
Save style.css and close it.
Now, open your FTP program or File Manager and connect to your server.
Upload your new child theme folder. Be sure that it gets uploaded to the wp-content/themes
folder on the server, and sits next to the other theme folders there.
Now log into your site's Admin and go to Appearance > Themes. If all went well, you should see
your child theme listed with the other themes. This is optional, but if you'd like to give
your child theme a thumbnail image like the other themes have, you'll need an image editor
and basic image editing skills. Create an image with the pixel dimensions
600 by 450 and save it as the image file type .png with the name screenshot.png.
Copy this image into the child theme folder and upload it to the server.
On the Manage Themes screen, your child theme should now display a thumbnail image.
Now click your child theme's Activate link, and it becomes the active theme. The front-end
website should look the same as it did with the parent theme activated. But now, any customizations
you make will be to the child theme, which is exactly the way it should be done.
So that's the process for setting up a child theme. Stay tuned to WeTeachWP.com for more
high-quality WordPress learning materials.