Get_template_part inside a folder

I assume you have a file in templates/masterhead-templatename.php, and it works, it is ok.

Correct me if I am wrong, you want to locate this file like this masterhead-templatename.php, basically one folder up, but this wordpress function does not work like this.

If the file exists in the root’s theme folder, it does not recognize it.

It is not supposed to do so.
It searches for a file templates/masterhead.php, sincetemplates/masterhead-templatename.php was not found.


The function specification get_template_part( 'templates/masthead', $my_theme->Template); searches like this:

STYLESHEETPATH/templates/masthead-themename.php
STYLESHEETPATH/templates/masthead.php
TEMPLATEPATH/templates/masthead-themename.php
TEMPLATEPATH/templates/masthead.php

Which file is found, that is included and the searching obviously stops.