The parent theme uses this construct to include the navbar:
include(locate_template( "components/navigation.php" ));
I would prefer to use the WordPress convention:
get_template_part( "components/navigation" );
in my child theme, to call the file from the parent theme, but his code works and mine doesn’t. What am I doing wrong?
UPDATE:
The surrounding code looks like this:
if ( $navigation_type != '' ) {
include(locate_template( "components/navigation.php" ));
}
This code loads fine, the debug log is empty. If I switch that code to
if ( $navigation_type != '' ) {
get_template_part( 'components/navigation' );
}
then The debug log fills with
PHP Notice: Undefined variable: navigation_type in /path/to/components/navigation.php on line 31