Title: get_author_template
Published: April 25, 2014
Last modified: April 28, 2025

---

# get_author_template(): string

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/get_author_template/?output_format=md#description)
    - [See also](https://developer.wordpress.org/reference/functions/get_author_template/?output_format=md#see-also)
 * [Return](https://developer.wordpress.org/reference/functions/get_author_template/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/get_author_template/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/get_author_template/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/get_author_template/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/get_author_template/?output_format=md#wp--skip-link--target)

Retrieves path of author template in current or parent template.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/get_author_template/?output_format=md#description)󠁿

The hierarchy for this template looks like:

 1. author-{nicename}.php
 2. author-{id}.php
 3. author.php

An example of this is:

 1. author-john.php
 2. author-1.php
 3. author.php

The template hierarchy and template path are filterable via the [‘$type_template_hierarchy’](https://developer.wordpress.org/reference/hooks/type_template_hierarchy/)
and [‘$type_template’](https://developer.wordpress.org/reference/hooks/type_template/)
dynamic hooks, where `$type` is ‘author’.

### 󠀁[See also](https://developer.wordpress.org/reference/functions/get_author_template/?output_format=md#see-also)󠁿

 * [get_query_template()](https://developer.wordpress.org/reference/functions/get_query_template/)

## 󠀁[Return](https://developer.wordpress.org/reference/functions/get_author_template/?output_format=md#return)󠁿

 string Full path to author template file.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/get_author_template/?output_format=md#source)󠁿

    ```php
    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 );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/template.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/template.php#L214)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/template.php#L214-L226)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/get_author_template/?output_format=md#related)󠁿

| Uses | Description | 
| [get_queried_object()](https://developer.wordpress.org/reference/functions/get_queried_object/)`wp-includes/query.php` |

Retrieves the currently queried object.

  | 
| [get_query_template()](https://developer.wordpress.org/reference/functions/get_query_template/)`wp-includes/template.php` |

Retrieves path to a template.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/get_author_template/?output_format=md#changelog)󠁿

| Version | Description | 
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_author_template%2F)
before being able to contribute a note or feedback.