加载模板部分

将代码从特定指定文件中拉入另一个进行调用的文件中。

例如在 example.php 中

<h1>Hello World!</h1>

在 page.php 里面

// header code
get_template_part('example');
// rest of page code

输出:

// header code
<h1>Hello World</h1>
// rest of page code