Example 1 — Daily archive heading
Print the day at the top of the archive.
<?php if ( is_day() ) {
echo '<h1>Posts from ' . get_the_date() . '</h1>';
} ?> How It Works
is_day()is true only when a day is in the URL.get_the_date()returns the date of the first post.- Month and year archives skip the code.

