Created
July 11, 2016 20:14
-
-
Save mor10/f2ec3d344331b0789942636248a7ef53 to your computer and use it in GitHub Desktop.
Alternative method for adding parent theme stylesheet to WordPress child theme
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 | |
// Enqueue the parent theme stylesheet, then the child theme stylesheet. | |
// Used in place of @import rule in child theme style.css | |
function child_theme_name_enqueue_styles() { | |
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); | |
wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array( 'parent-style' ) ); | |
} | |
add_action( 'wp_enqueue_scripts', 'child_theme_name_enqueue_styles' ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment