我做了以下步骤来设置我的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
答案 0 :(得分:1)
将@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
*/
@import "../canvas/style.css";
答案 1 :(得分:1)
所有,我想通了......我的网站受到用户名和密码的密码保护。我删除了身份验证,现在工作正常:)感谢您的帮助
答案 2 :(得分:0)
您不需要使用导入,WP会自动执行。