Child Themes

Child Themes can be used to override any part of the main theme, including the theme templates, CSS and Javascript. If you would like to make a Child theme and use it on this hosting service, please contact websolutions@leeds.ac.uk.

The CSS and Javascript assets included in the theme are pre-compiled and are used across multiple Content Management Systems to achieve a consistent layout and design elements across all sites in the leeds.ac.uk domain. Any changes to these design elements (creating new layouts, adjusting existing patterns or overriding styles and adding new scripts) should be submitted to the Web Solutions design team before any of the changes are made live.

Making a child theme

A child theme needs to have the appropriate file header in style.css:

/*
Theme Name:             Example Child Theme
Description:            Child theme of Toolkit WordPress Theme
Template:               toolkit-wordpress-theme
Author:                 Peter Edwards <p.l.edwards@leeds.ac.uk>
Version:                0.0.1
Theme URI:              https://bitbucket.org/university-of-leeds/example-child-theme
Bitbucket Theme URI:    https://bitbucket.org/university-of-leeds/example-child-theme.git
License:                GNU General Public License v2 or later
License URI:            http://www.gnu.org/licenses/gpl-2.0.html
*/

Other than this file, no other files are essential for the operation of the child theme.

The main theme does not include the child theme stylesheet, so you will need to do this manually in the child theme functions.php file:

<?php
/**
 * queue child theme styles
 */
function tk_child_theme_styles()
{
    wp_enqueue_style( 
        'tk_child_theme', 
        get_stylesheet_directory_uri() . '/style.css',
        '',
        '0.0.1',
        'screen'
    );
}
add_action( 'wp_enqueue_scripts', 'tk_child_theme_styles' );

If you want to add theme options for the child theme, or add custom page widgets to the widget page template, please see the following sections of this guide: