Skip to content

Instantly share code, notes, and snippets.

@ryanshoover
Created April 7, 2017 02:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanshoover/426d3fb37f295c1500c6d8b60345e3c8 to your computer and use it in GitHub Desktop.
Save ryanshoover/426d3fb37f295c1500c6d8b60345e3c8 to your computer and use it in GitHub Desktop.
Child theme starter
<?php
/**
* Functions for Ryan Hoover Child
*/
namespace RSH;
define( 'RSH_PATH', get_stylesheet_directory() );
define( 'RSH_URL', get_stylesheet_directory_uri() );
function enqueue_styles() {
$parent_style = 'twentyseventeen';
$parent_theme = wp_get_theme( $parent_style );
$css_parent_version = $parent_theme->get('Version');
$css_child_version = filemtime( RSH_PATH . '/dist/style.css' );
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css', [], $css_parent_version );
wp_enqueue_style( 'child-style', RSH_URL . '/dist/style.css', [ $parent_style ], $css_child_version );
}
add_action( 'wp_enqueue_scripts', '\RSH\enqueue_styles' );
/*
Theme Name: Ryan Hoover 2017 Child
Theme URI: http://ryan.hoover.ws
Description: Twentyseventeen Child Theme
Author: Ryan Hoover
Author URI: http://ryan.hoover.ws
Template: twentyseventeen
Version: 1.0.0
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment