WordPress Loading Template Part


Example

Pulls the code from a certain specified file into another file where the call was made.

E.g. inside example.php

<h1>Hello World!</h1>

Inside page.php

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

Output:

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