admin管理员组文章数量:1303450
I am trying to use child themes for the first time in Wordpress - and I've got it working (at least from a user's perspective - it functions correctly)
My concern is that both the parent and child CSS files are loaded - so I'm concerned about performance. Ideally, I just want the child's CSS file used.
My code in functions.php is the following - does anyone have any suggestions how to just rely on the min.css file from the child template?
<?php
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
function my_theme_enqueue_styles() {
$parent_style = 'johannes-style';
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/assets/css/min.css', array(), wp_get_theme()->get('Version'));
wp_enqueue_style( 'johannes-child-main', get_stylesheet_directory_uri() . '/assets/css/min.css', array( $parent_style ), wp_get_theme()->get('Version'));
}
Thanks in advance!
本文标签: templatesParentChild themesboth CSS files loaded
版权声明:本文标题:templates - ParentChild themes - both CSS files loaded 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741733879a2394971.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论