Activating child theme results in 500 Internal Server Error
-
Hi, I’ve have custom css modifying the Twenty Fourteen theme on https://www.kimnovakartist.com since we first built it early last year. I’ve had it contained in the Jetpack Edit css module to preserve it through updates. This weekend we needed to add a function to functions.php to exclude all but one category from the Home page, so I thought I might as well go ahead and make a child theme so that would be preserved through updates as well. Followed the instructions I found in the WP Codex to create style.css and functions.php. Created a directory in Themes for it and uploaded the text files. Activated the child theme, and site immediately went downdue to a 500 internal server error. Is this because I still had the Edit css module of Jetpack activated, or is it for some other reason?
Here’s my functions.php:(<?php) add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); function theme_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); } function theme_enqueue_styles() { $parent_style = 'parent-style'; wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array( $parent_style ) ); } add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); //Exclude categories from Home. function exclude_category_home( $query ) { if ( $query->is_home ) { $query->set( 'cat', '-1, -234' ); } return $query; } add_filter( 'pre_get_posts', 'exclude_category_home' );
Custom css is a long file, but here’s the header:
/* Theme Name: Twenty Fourteen Child Theme URI: https://www.kimnovakartist.com/twentyfourteen-child/ Description: Twenty Fourteen Child Theme, developed for www.kimnovakartist.com Author: Hannah West Design Author URI: https://www.hannahwestdesign.com Template: twentyfourteen Version: 1.0.0 License: GNU General Public License v2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Tags: dark, one-column, left-sidebar, responsive-layout Text Domain: twentyfourteen-child */
Not sure if I have included everything needed for someone to lend a hand, so let me know if there’s anything else you need. Naturally I have switched back to the Twenty Fourteen theme for now. Thanks!
- The topic ‘Activating child theme results in 500 Internal Server Error’ is closed to new replies.