Child themes

A child theme is a theme that inherits the functionality and styling of another theme, called the parent theme. Child themes are the recommended way of modifying an existing theme.

For example, child theme MKHA is the child of Shell-Lite.

A child theme consists of at least one directory – the child theme directory – and two files -style.css and functions.php – which you will need to create. (Note that using @import is no longer best practice.)

Unlike style.css, the functions.php of a child theme does not override its counterpart from the parent. Instead, it is loaded in addition to the parent’s functions.php. (Specifically, it is loaded immediately before the parent’s file.)

style.css

/*
 Theme Name: MKHA
 Description: Shell-Lite Child Theme
 Template: shell-lite
 Version: 1.0.0
 Text Domain: twenty-fourteen-child
 */
/* =Theme customization starts here
 -------------------------------------------------------------- */

functions.php

<?php

/*

 * Functions file

 */


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


?>