Css WordPress子主题错误

Css WordPress子主题错误,css,wordpress,wordpress-theming,Css,Wordpress,Wordpress Theming,嗨,我正在使用WooThemes的WordPress主题。我正在使用店面主题,并试图添加我自己的子主题(css文件),但它无法正常工作 我已经在setup.php函数文件中添加了它 function storefront_child_scripts() { if ( is_child_theme() ) { wp_enqueue_style( 'storefront-child-style', get_stylesheet_uri().'/custom-child.css

嗨,我正在使用WooThemes的WordPress主题。我正在使用店面主题,并试图添加我自己的子主题(css文件),但它无法正常工作

我已经在setup.php函数文件中添加了它

function storefront_child_scripts() {
    if ( is_child_theme() ) {
        wp_enqueue_style( 'storefront-child-style', get_stylesheet_uri().'/custom-child.css', array('parent-style'), '1.0.0' , 'all' );
    }
}
我还向css文件添加了我认为正确的语法

/*
Theme Name:     Storefront
Theme URI:      http://www.woothemes.com/storefront
Author:         WooThemes
Author URI:     http://www.woothemes.com
Description:    Storefront is the perfect theme for your next WooCommerce project. Designed and developed by WooThemes, it features a deep integration with our market leading WooCommerce plugin, several layout & color options to personalise your shop, multiple widget regions, a responsive design and much more. Developers will love it's lean and extensible codebase making it a joy to customise and extend. Looking for a WooCommerce theme? Look no further!
Version:        1.5.3
License:        GNU General Public License v2 or later
License URI:    http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:    storefront
Tags:           black, white, light, two-columns, left-sidebar, right-sidebar, responsive-layout, custom-background, custom-colors, custom-header, custom-menu, featured-images, full-width-template, threaded-comments, accessibility-ready, rtl-language-support
*/

@import url("../storefront/style.css");
当我在浏览器中检查它时,它显示在头部的最上方,但不正确,浏览器似乎无法找到它。我还觉得奇怪的是,当它最后一次加载时,它会在头顶加载。我显示为

<link rel="stylesheet" type="/custom-child.css" href="mystyle.css">

正如您所看到的,这是完全错误的href指向“mystyle”,我不知道它来自哪里,类型显示了我的文件名

如果任何机构有这方面的经验并愿意提供帮助,那就太好了。
谢谢

您始终可以安装一个名为custom css的插件,该插件将覆盖主css文件。在这种情况下,您甚至可以在后端自定义css,而无需使用ftp


我通常不建议这样做,因为这会使子主题变得毫无用处,除非您编写自己的函数

好极了。我马上去调查一下。感谢您的回复是的,您甚至可以在不编辑核心文件的情况下覆盖插件中的css。太棒了!如果答案有效,请将其标记为完整,谢谢!检查查看页面源样式表url是否正确。