Created
November 2, 2016 05:27
-
-
Save cryptexvinci/074ffaef38361c7aadf6a9c74ac71aa2 to your computer and use it in GitHub Desktop.
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 | |
add_action( 'wp_enqueue_scripts', 'enqueue_child_theme_styles', PHP_INT_MAX); | |
function enqueue_child_theme_styles() { | |
wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' ); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Line 2 in the code should NOT include the PHP_INT_MAX value in the priority parameter.
This results in the parent theme style rules taking precedence over the child style rules (defeating the purpose of the child theme) since the parent style file loads AFTER the child style file.
The call should simply be:
add_action( 'wp_enqueue_scripts', 'enqueue_child_theme_styles');