我稍后会加载儿童主题,如下所示。我不得不退队&;取消注册父样式,然后将父样式排入队列(&N);子样式。希望这有帮助
父母亲functions.php
有
add_action(\'wp_enqueue_scripts\', \'load_parent_style\', 10);
function load_parent_style() {
wp_enqueue_style(\'parent-theme-style\'); // parent theme code
}
儿童
functions.php
有
add_action(\'wp_enqueue_scripts\', \'load_child_style\', 20);
function load_child_style() {
//register & enqueue parent with new name
wp_register_style(\'parent-style\', $url, array($deps));
wp_enqueue_style(\'parent-style\');
// dequeue & deregister parent\'s theme handle
wp_dequeue_style(\'parent-theme-style\'); // from parent theme
wp_deregister_style(\'parent-theme-style\');
// register & enqueue child style
wp_register_style(\'child-style\', get_stylesheet_uri(), array(\'parent-style\'));
wp_enqueue_style(\'child-style\');
}