描述:
获取作者栏目页面模版文件author.php
用法:
<?php get_author_template() ?>
参数:
此函数不接收参数
源文件:
/**
* Retrieve path of author template in current or parent template.
*
* The template path is filterable via the dynamic {@see '$type_template'} hook,
* e.g. 'author_template'.
*
* @since 1.5.0
*
* @see get_query_template()
*
* @return string Full path to author template file.
*/
function get_author_template() {
$author = get_queried_object();
$templates = array();
if ( $author instanceof WP_User ) {
$templates[] = "author-{$author->user_nicename}.php";
$templates[] = "author-{$author->ID}.php";
}
$templates[] = 'author.php';
return get_query_template( 'author', $templates );
}