I'm trying to load my child theme's style.css
after the parent theme style.css
has already loaded. However, I have noticed that the style.css
doesn't need to be enqueued since it's implicitly enqueued by the WordPress core.
So I'm explicitly enqueuing it like this, where it is dependent on the parent-style
having already loaded:
function enqueue_theme_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', 'enqueue_theme_styles', PHP_INT_MAX );
The problem with this is that it's now loaded twice. Once implicitly and then explicitly. How can I load my child's style.css
after the parent's without loading it twice?
Here's what the head
looks like:
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php bloginfo('name'); ?> | <?php is_front_page() ? bloginfo('description') : wp_title(''); ?></title>
<?php if(isset($themeum['favicon'])){ ?>
<link rel="shortcut icon" href="<?php echo $themeum['favicon']; ?>" type="image/x-icon"/>
<?php }else{ ?>
<link rel="shortcut icon" href="<?php echo get_template_directory_uri().'/images/plus.png' ?>" type="image/x-icon"/>
<?php } ?>
<link rel="stylesheet" type="text/css" href="">
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<!--[if lt IE 9]>
<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js"></script>
<![endif]-->
<?php if(isset($themeum['before_head'])) echo $themeum['before_head'];?>
<?php wp_head(); ?>
</head>
style.css
.Genesis
does)