Using WordPress ‘get_the_archive_description()’ PHP function

The get_the_archive_description() WordPress PHP function retrieves the description for an author, post type, or term archive.

Usage

echo get_the_archive_description();

Parameters

  • None

More information

See WordPress Developer Resources: get_the_archive_description()

Examples

Displaying the description for an author archive

This example shows how to display the author’s description on an author archive page.

// In an author.php template file
echo '<p>' . get_the_archive_description() . '</p>';

Displaying the description for a custom post type archive

This example displays the description for a custom post type archive page.

// In a archive-{post-type}.php template file
echo '<p>' . get_the_archive_description() . '</p>';

Displaying the description for a category archive

This example shows how to display the category description on a category archive page.

// In a category.php template file
echo '<p>' . get_the_archive_description() . '</p>';

Displaying the description for a tag archive

This example displays the tag description on a tag archive page.

// In a tag.php template file
echo '<p>' . get_the_archive_description() . '</p>';

Displaying the description for a custom taxonomy term archive

This example shows how to display the description for a custom taxonomy term archive page.

// In a taxonomy-{taxonomy}.php template file
echo '<p>' . get_the_archive_description() . '</p>';