Example 1 — Print the date heading
Show a heading on every date archive.
<?php if ( is_date() ) {
echo '<h1>' . get_the_archive_title() . '</h1>';
} ?> How It Works
is_date()is true on year, month, day, and time archives.get_the_archive_title()returns the right title.- Other pages skip the heading.

