the_archive_title()WP 4.1.0

Display the archive title based on the queried object.

No Hooks.

Return

null. Nothing.

Usage

the_archive_title( $before, $after );
$before(string)
Content to prepend to the title.
Default: ''
$after(string)
Content to append to the title.
Default: ''

Notes

Changelog

Since 4.1.0 Introduced.

Code of the_archive_title() WP 5.9.3

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

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