Last active
October 17, 2016 07:39
-
-
Save edalis/289d9858502bb8c1d7de to your computer and use it in GitHub Desktop.
WP: Loading Parent Styles for Child Themes
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
// http://justintadlock.com/archives/2014/11/03/loading-parent-styles-for-child-themes | |
add_action( 'wp_enqueue_scripts', 'my_enqueue_styles' ); | |
function my_enqueue_styles() { | |
/* If using a child theme, auto-load the parent theme style. */ | |
if ( is_child_theme() ) { | |
wp_enqueue_style( 'parent-style', trailingslashit( get_template_directory_uri() ) . 'style.css' ); | |
} | |
/* Always load active theme's style.css. */ | |
wp_enqueue_style( 'style', get_stylesheet_uri() ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment