How to create child theme with Tesseract theme?

Follow the instructions as listed at http://codex.wordpress.org/Child_Themes

Specifically, in your wp-content/themes folder:

  • create another directory named Tesseract-child
  • in Tesseract-child create a style.css file
  • in your style.css file include the following header

style.css contents:

/*
 Theme Name:   Tesseract Child
 Theme URI:    http://example.com/
 Description:  Tesseract Child Child Theme
 Author:       John Doe
 Author URI:   http://example.com
 Template:     Tesseract
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  tesseract
*/

The important part to note here is the template: Tesseract attribute which should contain the name of the parent theme directory.

  • next in your child theme functions.php file include the following snippet

functions.php contents:

function theme_enqueue_styles() {

    $parent_style="parent-style";

    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 ));
}

add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );

…which will enqueue your child theme style.css file with the parent style.css as a dependency.

  • lastly, in your WordPress dashboard goto Appearance -> Themes and activate your child theme – Tesseract Child

This should be sufficient enough to get you going.

Leave a Comment