Assuming the theme folder is wp-content/themes, that the parent theme is twentyten, and the child theme is twentytenchild, then the following code –
get_template_part( 'content', get_post_format() );
that will look for files like content-link.php, content-gallery.php and so on. In fact, it will do a PHP require() for the first file that exists among these, in this priority:
Now, imagine you’re working on a child theme. You created content.php and content-gallery.php. You expect gallery posts to pick up content-gallery.php, which is correct.
You also expect a link post to pick up your content.php file because there is no content-link.php in your child theme, right? This is also correct, unless your parent theme has a content-link.php file, which will be of higher priority to the template loader, despite the child-parent relationship between the two themes.
It does make sense, otherwise a simple index.php file in your child theme would override all of the parent theme’s templates, because index.php is a fallback for everything. That would render child themes useless.
To use this function with subfolders in your theme directory, simply prepend the folder name before the slug. For example, if you have a folder called “partials” in your theme directory and a template part called “content-page.php” in that sub-folder, you would use get_template_part() like this:
get_template_part( 'partials/content', 'page' );