Skip to content

Instantly share code, notes, and snippets.

@edalis
Last active October 17, 2016 07:39
Show Gist options
  • Save edalis/289d9858502bb8c1d7de to your computer and use it in GitHub Desktop.
Save edalis/289d9858502bb8c1d7de to your computer and use it in GitHub Desktop.
WP: Loading Parent Styles for Child Themes
// 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