Created
April 7, 2017 02:31
-
-
Save ryanshoover/426d3fb37f295c1500c6d8b60345e3c8 to your computer and use it in GitHub Desktop.
Child theme starter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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