如何修复与设置 WordPress 子主题相关的这些错误消息?
我执行了以下步骤来设置我的 WordPress 子主题;但是,我收到以下错误消息:
1)在我的主题目录中创建了一个名为 canvas-child 的文件夹
2) 在此 canvas-child 目录中创建一个 style.css 文件,并将以下代码放在 .css 文件的顶部:
@import "../canvas/style.css";
/*
Theme Name: Canvas Child Theme
Theme URI: http://www.example.com/
Version: 1.0
Description: Custom Theme based on Canvas
Author: My Name
Author URI: http://www.example.com
Template: canvas
*/
3) 进入我的 WP 管理并激活此子主题...但是我收到以下错误:
Warning: fopen(http://www.example.com/wp-content/themes/canvas-child/style.css) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 401 Authorization Required in example.com/html/wp-includes/functions.php on line 4339
Warning: fread(): supplied argument is not a valid stream resource in example.com/html/wp-includes/functions.php on line 4342
Warning: fclose(): supplied argument is not a valid stream resource in example.com/html/wp-includes/functions.php on line 4345
I did the following steps to setup my WordPress child theme; however, I am receiving these error messages:
1) created a folder called canvas-child in my themes directory
2) created a style.css file within this canvas-child directory and put the following code at the top of the .css file:
@import "../canvas/style.css";
/*
Theme Name: Canvas Child Theme
Theme URI: http://www.example.com/
Version: 1.0
Description: Custom Theme based on Canvas
Author: My Name
Author URI: http://www.example.com
Template: canvas
*/
3) Went into my WP admin and activated this child theme...however I receive these errors:
Warning: fopen(http://www.example.com/wp-content/themes/canvas-child/style.css) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 401 Authorization Required in example.com/html/wp-includes/functions.php on line 4339
Warning: fread(): supplied argument is not a valid stream resource in example.com/html/wp-includes/functions.php on line 4342
Warning: fclose(): supplied argument is not a valid stream resource in example.com/html/wp-includes/functions.php on line 4345
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
将您的
@import "../canvas/style.css";
移至注释块下方:Move your
@import "../canvas/style.css";
to below the comment block:所有,我想通了......我的网站受到用户名和密码的密码保护。我删除了身份验证,现在工作正常:) 谢谢您的帮助
All, I figured it out...My website was password protected with a username and password. I removed the authentication and it works fine now :) Thank you for your help
您不需要使用导入,WP 会自动完成。
You don't need to use import, WP does it automatically.