apply_filters( 'template_include', string $template )
Filters the path of the current template before including it.
Description
Parameters
- $template
-
(string) The path of the template to include.
Source
Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |
More Information
This filter hook is executed immediately before WordPress includes the predetermined template file. This can be used to override WordPress’s default template behavior.
This example includes a new template on a page called ‘portfolio’ if the new template file was found.
Expand full source codeCollapse full source code