检索当前或父模板中的家庭模板的路径。
原型
get_home_template()
描述
模板层次结构和模板路径可通过’$ type_template_hierarchy’和’$ type_template’动态挂钩过滤,其中$ type为’home’。
参考:
- get_query_template()
返回值
(string)
家庭模板文件的完整路径。
源文件
路径:wp-includes/template.php
<?php
...
function get_home_template() {
$templates = array( 'home.php', 'index.php' );
return get_query_template( 'home', $templates );
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/get_home_template/