Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
css文件夹中的css文件在wordpress子主题中未被覆盖_Wordpress_Wordpress Theming - Fatal编程技术网

css文件夹中的css文件在wordpress子主题中未被覆盖

css文件夹中的css文件在wordpress子主题中未被覆盖,wordpress,wordpress-theming,Wordpress,Wordpress Theming,我在wordpress主题的css文件夹中有一个main.css文件,它在functions.php中按如下方式调用 wp_enqueue_style( 'td-main', THEME_WEB_ROOT . '/css/main.css' ); 在我的子主题中,我在与父主题相同的位置重新创建了一个css文件夹,但它没有被覆盖,这是我的子主题functions.php function theme_enqueue_styles() { wp_enqueue_sty

我在wordpress主题的css文件夹中有一个main.css文件,它在functions.php中按如下方式调用

wp_enqueue_style( 'td-main',            THEME_WEB_ROOT . '/css/main.css' );
在我的子主题中,我在与父主题相同的位置重新创建了一个css文件夹,但它没有被覆盖,这是我的子主题functions.php

function theme_enqueue_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', 'theme_enqueue_styles');
我认为在子主题中重新创建文件就足够了,但不明白为什么它不起作用。 我做错什么了吗?

array('parent-style')
结尾