Example 1 — Print an archive title
Show the archive heading for every archive page.
<?php if ( is_archive() ) {
the_archive_title( '<h1 class="page-title">', '</h1>' );
} ?> How It Works
is_archive()is true on category, tag, author, and date pages.the_archive_title()prints the heading that fits the page.- On other pages the code is skipped.

