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