Macbook Laptop with Code Editor on Screen

How to Create a Child Theme for the BuSo Lightning WordPress Theme

Paul Gallipeau Web Design & Development 0 Comments

You need a child theme to make changes to your WordPress website that won’t be lost when your BuSo Lightning theme is updated or when the WordPress CMS is updated. This guide will show you how to get your child theme setup so you can safely edit your functions.php code.

ASSUMPTION
This guide assumes that you know how to use FTP. I use WinSCP because it’s free and it’s what I got used to. If you don’t know what any of this means, let me YouTube it for you.

STEP 1 – CREATING YOUR DIRECTORY

Navigate to your WordPress directory on your server and find your themes folder under /wp-content/themes/

Click on the pretty little “new folder” icon (top arrow) or press f7 and create a new folder entitled “busolightning-child” (second arrow).

STEP 2 – CREATING YOUR FILES

Now open the child theme folder you just created and create the file “style.css” (in WinSCP, you can do this with “right click > new > file” or by pressing shift+f4). In your style.css file, paste the following text:

/*
Theme Name: Buso Lightning Child Theme
Author: Builder Society
Description: The Fastest WP Theme Ever
Tags: White, Blue, Light
Template: busolightning
Version: 2.0
Text Domain: buso
License: GNU General Public License v2.0
License URI: http://www.gnu.org/licenses/gpl-2.0.html
BuSo Lightning, Copyright 2015-2016 BuilderSociety.com
BuSo Lightning is distributed under the terms of the GNU GPL
*/

You should also create functions.php in your child theme’s folder. WinSCP doesn’t let you create a blank file, so here’s so commented code you can paste into yours to get you started. I use this index to keep all of my functions.php additions organized.

<?php

// =====
// TABLE OF CONTENTS
// =====

// =====
// 0.1 - Enqueue Stylesheet
// =====

function example_enqueue_styles() {	
	// enqueue parent styles
	wp_enqueue_style('parent-theme', get_template_directory_uri() .'/style.css');	
	// enqueue child styles
	wp_enqueue_style('child-theme', get_stylesheet_directory_uri() .'/style.css', array('parent-theme'));	
}
add_action('wp_enqueue_scripts', 'example_enqueue_styles');

?>

Make sure that all of the code you add you to your functions.php file stays within the <?php opening tag and the ?> closing tag.

For my fellow visual learners, here’s what your child theme directory should look like in WinSCP:

STEP 3 – ACTIVATE YOUR CHILD THEME

Now go to your Themes menu in your WordPress backend, you should see this:

Just activate your child theme and you’re good to go. You can now edit these child theme files from the WordPress editor.

Now you’re done, good job!

Leave a Reply

Your email address will not be published. Required fields are marked *