我已经安装了Faxhion 客户的主题successfully 创建了子主题。然而,不知何故,我无法覆盖父主题css。
类似的问题,如this one &;this one 有人问我,我已经按照这两方面的说明进行了操作,我已经成功地看到我的孩子主题css正在应用,如下图所示。
如果查看开发工具的右下角,可以看到body{background: blue;}
以儿童主题的样式。css。The issue 你能看到吗main.css
正在取消子主题的样式。css。我不知道如何解决这个问题,因为我是WP-Dev的新手。
以下是子主题注释标题:
/*
Theme Name: Faxhion Child
Author: Jordan Miguel
Template: faxhion
Version: 0.1
*/
body {
background: blue;
font-size: 30px;
}
下面是我如何使用父主题css**注意@import
对我不起作用,所以我使用functions.php as stated
here - <?php
add_action( \'wp_enqueue_scripts\', function() {
//* Parent CSS
wp_enqueue_style( \'faxhion\',
get_template_directory_uri() . \'/main.css\' );
//* Child CSS
wp_enqueue_style( \'faxhion-child\',
get_stylesheet_directory_uri() . \'/style.css\', [ \'faxhion\' ], );
} );
EDIT 以下是stylesheets
在head
. 父主题css链接在子主题css的上方,是否应该更改? <link rel=\'stylesheet\' id=\'faxhion-css\' href=\'http://www.rareselect.co.uk/wp-content/themes/faxhion/main.css?ver=4.8.1\' type=\'text/css\' media=\'all\' />
<link rel=\'stylesheet\' id=\'faxhion-child-css\' href=\'http://www.rareselect.co.uk/wp-content/themes/faxhion-child/style.css?ver=0.1\' type=\'text/css\' media=\'all\' />
<link rel=\'stylesheet\' id=\'plugins-css\' href=\'http://www.rareselect.co.uk/wp-content/themes/faxhion/assets/css/plugins.css?ver=4.8.1\' type=\'text/css\' media=\'all\' />
<link rel=\'stylesheet\' id=\'fontawesome-css\' href=\'http://www.rareselect.co.uk/wp-content/themes/faxhion/assets/css/font-awesome.min.css?ver=4.8.1\' type=\'text/css\' media=\'all\' />