The What
It’s been available for you since version 2.7.0.
Description
This construct automatically loads the specified template file.
Parameters
template_file
- The fully qualified path to the template file to be loaded.
require_once
- optional When set to
true
, a PHPrequire_once
will be used to autoload the file; else a PHPrequire
is used.
Return Values
The function does not return anything.
If you listen carefully, you can hear the 1s and 0s flowing in your computer.
Real World ExamplesBasic
Let’s look at three different themes in order to see how to use load_template
.
Go Deep into CorePro
Let’s go into WordPress Core, walk through it line-by-line to understand how it works.
PHP Constructs
This function uses the following PHP constructs: