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