UPDATE: Solved! (02/06/17)
Thanks to everyone who helped give insight into this issue!
What Caused the Problem?
The root of the problem turned out to be that I copied the whole parent theme folder contents into the child theme. While this is good practice in general web development when creating a new website from an older one (start by duplicating the older site then editing folder contents as necessary), WordPress child themes work a little differently.
What Fixed It?
Child themes should start with the bare minimum: an appropriately-named child theme folder containing a style.css file and a functions.php file. The functions.php in the child should reference the functions.php in parent as per Nathan's instructions.
ORIGINAL:
THE ISSUE
My question is WordPress-specific. I installed WP for a client at http://hepkatorganics.com. I'm new to child themes, but the instructions on the Codex and this tutorial (Understanding WordPress Child Themes in 2016), seemed pretty easy to follow. But somehow editing the comments section of the style.css file seems to have broken my website. That doesn't make sense from a pure CSS standpoint to my knowledge because comments are ignored by CSS. I get error 500 in Chrome, and in Firefox I just get a blank page with no view source
content whatsoever.
A little more info to understand where I am coming from: I just completed 3 quarters towards an associate in web development and I got straight-A's (4.0) in HTML5/CSS3 and Advanced CSS & Preprocessors classes. I also go an A in Intro to WordPress programming.
Like I said, I'm new to child themes, and maybe this one of those "gotchas" that experienced WP developers already know about.
MY PROCESS
I followed the steps (with slight customization) as follows:
- Installed and activated free WP theme EightStore Lite.
- Copied the entire parent theme folder locally from
wp-content/themes/eightstore-lite
and renamed the exact copy of the parenteightstore-lite-ehw-1
. Edited style.css --> just the comment header. Here is the original code I copy & pasted from the Codex:
/* Theme Name: Twenty Fifteen Child Theme URI: http://example.com/twenty-fifteen-child/ Description: Twenty Fifteen Child Theme Author: John Doe Author URI: http://example.com Template: twentyfifteen Version: 1.0.0 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready Text Domain: twenty-fifteen-child */
Uploaded the entire child theme folder to the
wp-themes
folder on the server and launched the website. WORKED. Previewed the child theme. WORKED.Edited the comment header as follows:
/* Theme Name: EightStore Lite - EHW - 1 Theme URI: https://wordpress.org/themes/eightstore-lite/ Description: EightStore Lite Child Theme Author: Eric Hepperle Author URI: http://erichepperle.com Template: eightstore-lite Version: 1.0.0 Date Created: 02/03/2017 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready Text Domain: eightstore-lite-ehw-1 */
Notice I changed all fields except
Version, License, License URI, and Tags
.Re-uploaded the entire child theme folder to the
wp-themes
folder on the server and launched the website. WORKED. Previewed the child theme. WORKED.Added this line, per the video tutorial:
@import url("../eightstore-lite/style.css");
Re-uploaded the child theme. The theme showed up in the theme chooser uder "Appearance". It was either when I clicked to preview the theme or to activate it that everything went haywire. Received page won't load error:
HTTP ERROR 500
The final version of the style.css file is:
/* Theme Name: EightStore Lite - EHW - 1 Theme URI: https://wordpress.org/themes/eightstore-lite/ Description: EightStore Lite Child Theme Author: Eric Hepperle Author URI: http://erichepperle.com Template: eightstore-lite Version: 1.0.0 Date Created: 02/03/2017 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready Text Domain: eightstore-lite-ehw-1 */
/* OLD WAY --> Not Recommended!:
@import url("../eightstore-lite/style.css"); */
Notice this file only has CSS comments.
MY QUESTIONS
How can a file that is only css comments break a WordPress website?
What is the issue with my configuration? I mean, I haven't even started editing the actual css yet!
What is the key thing I should know going forward to prevent this WordPress website breaking scenario?
Any help is appreciated.