Alexa Green
Alexa Green

Reputation: 1183

How do I fix these error messages associated with setting up a WordPress child theme?

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

Upvotes: 0

Views: 796

Answers (3)

Alexa Green
Alexa Green

Reputation: 1183

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

Upvotes: 1

stealthyninja
stealthyninja

Reputation: 10371

Move your @import "../canvas/style.css"; to below the comment block:

/*
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";

Upvotes: 1

Gediminas
Gediminas

Reputation: 864

You don't need to use import, WP does it automatically.

Upvotes: 0

Related Questions