get_template() WordPress Function
The get_template() function is used to retrieve the path of the current theme's template file. This function is useful for retrieving the path of template files so that they can be included in other files.
get_template() #
Retrieves name of the active theme.
Return
(string) Template name.
More Information
This function retrieves the directory name of the current theme, without the trailing slash. In the case a child theme is being used, the directory name of the parent theme will be returned. Use get_stylesheet() to get the directory name of the child theme.
Source
File: wp-includes/theme.php
function get_template() { /** * Filters the name of the active theme. * * @since 1.5.0 * * @param string $template active theme's directory name. */ return apply_filters( 'template', get_option( 'template' ) ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
1.5.0 | Introduced. |