string $template )
Filters the path of the current template before including it.
The path of the template to include.
This filter hook is executed immediately before WordPress includes the predetermined template file. This can be used to override WordPress’s default template behavior.
View all references
$template = apply_filters( 'template_include', $template );
This example includes a new template on a page called ‘portfolio’ if the new template file was found.
It is advisable to use a different variable for the new template, check if the file for the new template exists, and if not, use the original value. — By crstauf —