Customize Prebuilt WordPress Themes to allow auto-updates and Improve Google Page Speed

Developer customizing WordPress theme

Do you want to customize a pre-built WordPress theme without losing all the benefits of having a nicest theme you chose, but not sure about how to start? You’re not alone. As digital marketers, we often find ourselves in situations where customizing is required to build that one section of a template, or a full new template. Fortunately, with WordPress there are ways to customize existing templates without causing a mess or running into big development issues later down the line when you get security or feature updates coming from the theme author. In this blog post, we’ll go over how to properly customize pre-built WordPress themes so that you can make your websites look great while still leveraging all of the powerful features available from premium template providers. Let’s dive in!

What you will learn:

  1. What is a WordPress child theme and why would you want to create one
  2. How to create a child theme for your WordPress website
  3. How to customize a pre-built WordPress theme using your child theme
  4. Tips for keeping your child themes updated and organized

Just before you dive into a DIY solution, I would like you to know that at WPSPIN LLC, we do customize WordPress themes that are Mobile-friendly, reliable, fast, up-to-date and search engines just love it. If you are looking for a valet service, feel free to Start an instant Chat

What is a WordPress child theme and why would you want to create one

Child themes are a great way to get the most out of your theme design while preserving and protecting customizations. By using them, you can take advantage of everything that went into creating the parent theme without spending extra time developing one from scratch, as well as upgrade with confidence knowing any modifications won’t be majorly affected by changes made in later updates. Best of all – should you ever want or need it, child themes make portability simple!

How to create a child theme for your WordPress website

Let’s take an example of TwentyTwentyTwo theme that comes along with WordPress(in the year 2022)
1. To make a child theme for your WordPress site, start by creating a new folder in the themes directory – located at wp-content/themes. Make sure to give it an appropriate title; typically you should use the same name as its parent and add “-child” on the end (e.g., if using TwentyTwentyTwo, then call it “TwentyTwentyTwo-child”).

2. To make this new folder visible under WordPress admin theme setting, create a stylesheet file called ‘style.css’. Don’t forget to include the required header comment at the top – it tells WordPress that this is a child theme with its specific parent!

/*
Theme Name:   Twenty Twenty Two Child
Theme URI:    https://your-website-url-here
Description:  Anything you wanna say about this new awesome theme
Author:       Your name (moment of proud)
Author URI:   http://your-linkedin-url (another moment of proud)
Template:     twentytwentytwo
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:  twentytwentytwochild
*/

3. The last step is crucial to ensure your parent theme styles aren’t overlooked – enqueue the necessary parents and child themes! With this quick action, you can be sure that everything runs smoothly without having to reinvent anything.
Create a new file under your child theme directory you created and name it functions.php and add following code that works with most of the themes

<?php
add_action( 'wp_enqueue_scripts', 'child_theme_enqueue_style' );
function child_theme_enqueue_style() {
	wp_enqueue_style( 'child-style',
		get_stylesheet_uri(),
		array( 'parenthandle' ),
		wp_get_theme()->get( 'Version' )
	);
}

4. Active your child theme

How to customize a pre-built WordPress theme using your child theme

To customize any file/template that you see in parent file can just be done if you copy that file from the parent theme into your child theme, keeping the exact same name of that file. With the new file on your child theme folder, you can edit anything you want and your parent theme will be intact in the background. in general, your child theme files will just overtake the parent files if it’s the same name(it excludes styles.css and functions.php file as they work on top of the parent files instead of replacing them)

For advanced users, you can definitely go to this official guide: https://developer.wordpress.org/themes/advanced-topics/child-themes/

Tips for keeping your child themes updated and organized

  • If the theme is downloaded from inside the WordPress repo, please make sure to turn on the automatic updates(this is active by-default, unless your hosting has disabled it)
  • If you have bought a theme on marketplaces like Themeforest or Envato, make sure you have an active license and it is set to auto updates
  • For the name of child theme, make sure you keep the name easily understandable
  • If you are editing a child theme that you created in the past, it is suggested to create a second version using the styles.css version attribute and go back to older versions when you require
  • Always use a FTP service(I use Filezilla) or use a SVN to edit any theme or plugin files. Using a theme editor or a code editor from your hsoting portal will result in file corruption in most cases
  • Always take a backup before you edit anything

Wow! That was a lot to take in. Creating a child theme for your WordPress website does seem like a daunting task, but hopefully now you have the essential knowledge and understand the importance of doing so. With a child theme, you can make minor customizations to an existing template or start from scratch in creating something totally unique and personally tailored to your needs. Not to mention having a place where all of your hard work is stored safely and securely! Have fun experimenting with different customization options to find which layout works best for you–go crazy! Be creative and let your inner nerd out. At the end of the day, any changes will be backed up on your child theme so if anything ever goes wrong it can be rolled back in no time at all. Now it’s time for some practical application; why not create a child theme today? I’d love to hear how it went by telling me in the comments–go ahead, give it a shot!