wp_enqueue_styles not working
-
Trying to use the enqueue styles instead of the @import and am having a couple problems.
The child theme css is loading – BUT SO IS THE PARENT THEME. I believe the Parent theme is loading AFTER the child theme because when I look at “inspect element” in Google Chrome – it shows the div twice – one with my child theme modifications in it – and then one with the original parent theme CSS (which is overwriting my changes)
Here is the php in the child theme functions file:
<?php
add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’ );
function theme_enqueue_styles() {
wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ );
wp_enqueue_style( ‘child-style’, get_stylesheet_uri(), array( ‘parent-style’ ) );
}?>
What am I doing wrong? (sorry – pretty much a Noob & php)
- The topic ‘wp_enqueue_styles not working’ is closed to new replies.