Create a child theme for WordPress

Generic selectors
Exact matches only
Search in title
Search in content
Filter by Categories
Account Management Help
add photos, video and audio
Add-on features and social media
Advanced
Advanced campaign settings
All about analytics
All about images
Basic steps
Calendar
Configure the Web Application Firewall (WAF)
Connect my Calendar and Online Storage to Workspace
contact support
copy files to my site
Create my email address
Customize campaign
Discover domains
discover linux hosting with cPanel
Discover Microsoft 365
Discover Online Storage
Discover Workspace Email
edit content
Email Marketing demo
expand your site with sections and pages
Explore email add-ons
Explore my account
Find server and port settings (IMAP/POP)
fine tune my website
get social
Get started with SSL certificates
Get the most out of Microsoft 365
help my site get found and monitor my metrics
Hosting & Servers
keep my account secure
Keep my email secure
know your privacy rights
Legacy
Manage your SSL certificate
Managed WordPress
Manual email configuration
Migrate and export my emails
My email account isn’t working (troubleshooting)
nameservers and DNS
online store
organize
parking, forwarding and monetizing
privacy and protection
publish my site
Quick Shopping Cart
Renew my products and services
renewals
Security
Set up a campaign
Set up email on my devices
set up my payment methods
Set up my Workspace Email account
start with the basics
Stay productive anywhere with Office apps
Streamline email tasks to help my business
transfer between accounts
transfer between registrars
Troubleshoot email and email setup
Troubleshooting
troubleshooting
Uncategorized
Upgrade and renewal options for email
Web & Classic Hosting
Website backups
Website Builder 7
Website Builder version 6
Website Security and Backups
Websites
work with databases
work with delegates
working with blogs

Sometimes, you may want to modify a WordPress theme. The best practice for modifying a theme’s style and functionality is through a child theme to prevent your changes from being lost when performing updates.

  1. Connect to your hosting with FTP
  2. Navigate to the wp-content/themes directory for your WordPress site.
  3. Create your child theme directory. The following is a common naming convention for child themes: <parent>-child, where <parent> is the name of your parent theme.
  4. Navigate into the child theme directory and create a style.css file.
  5. In the style.css file, add a stylesheet header, which contains metadata about your theme. The following is an example that you can use from a Twenty Fifteen child theme:
/*
Theme Name:   Twenty Fifteen Child
Theme URI:    http://example.com/twenty-fifteen-child/
Description:  Twenty Fifteen Child Theme
Author:       John Doe
Author URI:   http://example.com
Template:     twentyfifteen
Version:      1.0.0
License:      GNU General Public License v2 or later
License URI:  http://www.gnu.org/licenses/gpl-2.0.html
Tags:         light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
Text Domain:  twenty-fifteen-child
*/

Make sure to replace the information in the example with the information relative to your theme.

6. Save the style.css file.
7. Now create a functions.php file. This will contain PHP functions specific to your child theme.
8. After creating the functions.php file, you will need to enqueue the styles and scripts from your parent theme into your child theme.

  • Open the functions.php file
  • Add a function that will be used to enqueue styles and scripts from your parent theme. Below is an example.
<?php
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
    function my_theme_enqueue_styles() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . 'https://u7g4j3c4.rocketcdn.me/style.css' );
    }
?>
     

Next steps

More info