Title: the_archive_title
Published: December 18, 2014
Last modified: August 20, 2026

---

# the_archive_title( string $before = '', string $after = '' )

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/the_archive_title/?output_format=md#description)
    - [See also](https://developer.wordpress.org/reference/functions/the_archive_title/?output_format=md#see-also)
 * [Parameters](https://developer.wordpress.org/reference/functions/the_archive_title/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/functions/the_archive_title/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/the_archive_title/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/the_archive_title/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/the_archive_title/?output_format=md#user-contributed-notes)

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

Displays the archive title based on the queried object.

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

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

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

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/the_archive_title/?output_format=md#parameters)󠁿

 `$before`stringoptional

Content to prepend to the title.

Default:`''`

`$after`stringoptional

Content to append to the title.

Default:`''`

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

    ```php
    function the_archive_title( $before = '', $after = '' ) {
    	$title = get_the_archive_title();

    	if ( ! empty( $title ) ) {
    		echo $before . $title . $after;
    	}
    }
    ```

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

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

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

Retrieves the archive title based on the queried object.

  |

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

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

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/the_archive_title/?output_format=md#user-contributed-notes)󠁿

 1.   [Skip to note 4 content](https://developer.wordpress.org/reference/functions/the_archive_title/?output_format=md#comment-content-1903)
 2.    [rabmalin](https://profiles.wordpress.org/rabmalin/)  [  10 years ago  ](https://developer.wordpress.org/reference/functions/the_archive_title/#comment-1903)
 3.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_archive_title%2F%23comment-1903)
     Vote results for this note: 4[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_archive_title%2F%23comment-1903)
 4.  **Display archive title.**
 5.      ```php
         the_archive_title( '<h1 class="page-title">', '</h1>' );
         ```
     
 6.   [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_archive_title%2F%3Freplytocom%3D1903%23feedback-editor-1903)
 7.   [Skip to note 5 content](https://developer.wordpress.org/reference/functions/the_archive_title/?output_format=md#comment-content-2044)
 8.    [Anthony Hortin](https://profiles.wordpress.org/ahortin/)  [  10 years ago  ](https://developer.wordpress.org/reference/functions/the_archive_title/#comment-2044)
 9.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_archive_title%2F%23comment-2044)
     Vote results for this note: 4[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_archive_title%2F%23comment-2044)
 10. See Also
 11. [the_archive_description()](https://developer.wordpress.org/reference/functions/the_archive_description)–
     Display category, tag, term, or author description
 12.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_archive_title%2F%3Freplytocom%3D2044%23feedback-editor-2044)
 13.  [Skip to note 6 content](https://developer.wordpress.org/reference/functions/the_archive_title/?output_format=md#comment-content-272)
 14.   [Hugo Baeta](https://profiles.wordpress.org/hugobaeta/)  [  11 years ago  ](https://developer.wordpress.org/reference/functions/the_archive_title/#comment-272)
 15. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_archive_title%2F%23comment-272)
     Vote results for this note: 1[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_archive_title%2F%23comment-272)
 16. Used for returning/displaying the title of the current term, date, post type, 
     post format, or author archive.
 17.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_archive_title%2F%3Freplytocom%3D272%23feedback-editor-272)

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