I'm trying to make my own child theme from Twenty Fifteen. Everything looks and functions fine, but when I turn on debugging, I can see a PHP error:
Undefined variable: parent_style
on line 13 of functions.php of my child theme.
Here is the content of the functions.php file.
<?php /*
This file is part of a child theme called spch.
Functions in this file will be loaded before the parent theme's functions.
For more information, please read https://codex.wordpress.org/Child_Themes.
*/
// this code loads the parent's stylesheet (leave it in place unless you know what you're doing)
function theme_enqueue_styles() {
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');
/* Add your own functions below this line.
What am I doing wrong?