Sometimes you may want to modify a WordPress theme beyond what the customizer allows. In these instances, you may have to modify the code of your WordPress theme. It’s best practice to create a child theme prior to modifying any of your theme’s code so as to prevent your changes from being lost when updates are performed.
- First, you’ll want to modify the files through your host’s file manager or by connecting our hosting provider with FTP.
- Next, you’ll navigate to the wp-content/themes folder for your WordPress website.
- Then, you’ll want to create your child theme folder. A popular naming scheme for child themes is ParentTheme-child, where “ParentTheme” is the name of your theme.
- Once that folder is created, go into it and create a style.css file.
- Inside of style.css you will add a stylesheet header containing metadata about your theme. Below is an example using the Twenty Nineteen theme as a parent.
/*
Theme Name: Twenty Nineteen Child
Theme URI: http://www.example.com/twenty-nineteen-child/
Description: Twenty Nineteen Child Theme
Author: Your Name
Author URI: Insert your website
Template: twentynineteen
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/license/gpl-2.0.html
Tags: Insert any tags you want to be associated with your theme
Text Domain: twenty-nineteen-child
*/ - Be sure you change the information in the example to be relative to your theme, and then save your style.css file.
- Next, you’ll also create a functions.php file. This will contain the PHP functions for your child theme.
- After creating your functions.php file you’ll place functions inside that add functions from your parent theme.
- First, open the functions.php file
- Then, add a function that will add your parent theme’s styles and scripts as seen below.
<?php
add_action (‘wp_enqueue_scripts’, ‘my_theme_enqueue_styles’);
function my_theme_enqueue_styles() {
wp_enqueue_style (‘parent-style’, get_template_directory_uri() .’/style.css’);
}
?>
What’s Next?
Learn How To Change Your WordPress theme
Go back to How To Make A Child Theme In WordPress
About RdyToGo, Firebolt, and the Pro-How Technology Training Service
RdyToGo, pronounced “Ready To Go,” is a creative marketing agency with design studios in Myrtle Beach, South Carolina, and Jacksonville, Florida.
Our mission is to help entrepreneurs better the world. We do this with our web design, branding, marketing, and training services.
It is very important to offer marketing and technology-based training through our Pro-How service because it speaks directly about our mission, vision, and beliefs. Additionally, we offer static WordPress hosting services through Firebolt for those who need the performance.
What can RdyToGo do to further our mission? Education, promotion, and empowerment are the keys to helping entrepreneurs #BetterTheWorld. We use our specific skills in the following ways.
- Education: RdyToGo offers the Pro-How service to train people with skills to help them change their world.
- Promotion: Our creative marketing, branding, and web design services promote our clients, helping more people know what they can do.
- Empowerment: At our core, we feel that all people, regardless of background, deserve to enjoy the reward of their hard work. Our efforts are designed to empower people to grow, make changes in their lives, and better the world.
Why not join RdyToGo on our adventure? Try our free and paid training services, or hire us for to take on your marketing, web design, or branding project. Call 1-888-705-3403 or visit RdyToGo.com to get started.