I want to create a website in wordpress, for this I take a theme and create a child theme.
I copy in the folder of the child a style.css and header.php, because I w
You need get_stylesheet_directory_uri, this function checks first in the child theme directory and then in the parent's. The one you're using only checks in the parent directory.
Bottom line: if a function doesn't behave as you expect, check the Codex. Much probably you'll find out why over there.
Add to functions.php
:
// create a URL to the child theme
function get_template_directory_child() {
$directory_template = get_template_directory_uri();
$directory_child = str_replace('storefront', '', $directory_template) . 'child-storefront';
return $directory_child;
}