Get_template_part () is used to refer to template files, similar to Get_header (), Get_sidebar (), and Get_footer (), except that this get_template_part () can introduce a custom name file.
How to use
Get_template_part ($slug, $name);
Parameters
$slug
(string) (must) the file name of the template to be introduced, excluding the suffix name. php, that is, if you need to introduce the loop.php file of the current theme root directory $slug fill in "loop".
Default: None
$name
(string) (optional) The file name of the template to be introduced, if you want to introduce the loop-img.php file of the root of the current topic $slug parameters to fill in "loop", $name the Parameter Fill "img".
Default value: None
return value
There is no return value for this function.
Example
Endskin.com file that introduces the root directory of the current theme:
Get_template_part (' Endskin ');
Introduce the loop.php file for the current theme part directory:
Get_template_part (' Part/loop ');
endskin-com.php file that introduces the root directory of the current theme:
Get_template_part (' endskin ', ' com ');
Other
This function is located at: wp-includes/general-template.php
The above introduces the WordPress theme template file Introduction method, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.