starter-theme
starter-theme copied to clipboard
home.twig template doesn't exist
index.php contains the following:
$templates = array( 'index.twig' );
if ( is_home() ) {
array_unshift( $templates, 'home.twig' );
}
So, if the current page is the home page, home.twig should be added in front of index.twig in the $template array, yet there is no home.twig template included.
@misfist
array_unshift() - prepends passed elements to the front of the array. php.net
If there's no home.twig template it will default to index.twig. Think of the $templates array as fallback list of templates. This starter theme is just emulating what WordPress already does if you review WordPress Template Hierarchy.