exhtml
9/3/2014 - 10:42 AM

Setting up a Child Theme the right way

Setting up a Child Theme the right way

/*
 Theme Name:   Name Child Theme
 Theme URI:    http://example.com/name-child-theme/
 Description:  Description about this Child Theme
 Author:       your name
 Author URI:   http://yoursite.com
 Template:     parent-theme-slug
 Version:      optional
 Tags:         optional
 Text Domain:  name-child-theme
*/

/* =Theme customization starts here
-------------------------------------------------------------- */
<?php
/**
 * The right way to make a child theme is to
 * enqueue the stylesheet of the parent in the
 * functions file of the child.
 *
 * used in wpti.ps/?p=512
 */
function so_enqueue_parent_theme_css() {

	wp_enqueue_style( 'parent-theme', get_template_directory_uri() . '/style.css' );

}

add_action( 'wp_enqueue_scripts', 'so_enqueue_parent_theme_css' );