Skip to content

Instantly share code, notes, and snippets.

@samikeijonen
Last active August 29, 2015 14:08
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 samikeijonen/a2773f53b9a8c8663e01 to your computer and use it in GitHub Desktop.
Save samikeijonen/a2773f53b9a8c8663e01 to your computer and use it in GitHub Desktop.
Load styles in parent theme.
<?php
/**
* Enqueue scripts and styles.
*/
function my_theme_scripts() {
/* Enqueue parent theme styles. */
wp_enqueue_style( 'theme-slug-style', trailingslashit( get_template_directory_uri() ) . 'style.css', array(), THEME_VERSION );
/* Enqueue child theme styles. */
if ( is_child_theme() ) {
wp_enqueue_style( 'theme-slug-child-style', get_stylesheet_uri(), array(), null );
}
}
add_action( 'wp_enqueue_scripts', 'my_theme_scripts' );
@samikeijonen
Copy link
Author

For more info check out how I load styles in Kuorinka theme.

There is also note in child themes not to use @import rule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment