WordPress at a glance

the_archive_description() WP 4.1.0

Display the description of the post type, category, tag, term, or author archive page.

This function is useful to display the description of archive page of any type in the theme.

On author archive page, the description is retrieved from his Biographical Info field; on taxonomies archive pages — from their description field. For posts types archive pages — with get_the_post_type_description() function.

No Hooks.

Return

Null. Nothing.

Usage

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

Examples

#1 Display the description of the archive page (except date archive pages)

Let's display a description for tags, categories, taxonomies or authors.

There is no description for date archive page, because there is no place in admin where you can fill it and there is no place in DB to save it. Moreover, description for date archive almost never used on sites. See code of get_the_archive_description() for details.

<?php the_archive_description(); ?>

Notes

  • See: get_the_archive_description()

Changelog

Since 4.1.0 Introduced.

Code of the archive description: wp-includes/general-template.php WP 5.2.4

<?php
function the_archive_description( $before = '', $after = '' ) {
	$description = get_the_archive_description();
	if ( $description ) {
		echo $before . $description . $after;
	}
}

Related Functions

From tag: Description (of post term)

More from category: Archives

More from Template Tags: Main Functions

No comments
    Hello, !     Log In . Register