我正在加载我孩子的主题style.css
在父主题之后style.css
已加载。然而,我注意到style.css
不需要排队,因为它是由WordPress内核隐式排队的。
所以我明确地把它排成这样,它依赖于parent-style
已加载:
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 );
问题是现在loaded twice. 一次隐式,然后显式。我怎样才能装我孩子的style.css
在家长没有加载两次之后?下面是head
看起来像:
<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>