Why are some of my Wordpress posts not showing a date?

Wordpress’ the_date() function hides the date if two posts in a row have the same date. When this happens without explanation in a Wordpress theme you’re building, it can seem like a strange bug.

The missing dates are a hold-over from Wordpress’ origins as blog software, where you would usually display the date as a heading, then display all the posts from that date underneath it. Now, most blogs no longer use that style, never mind the wide range of other websites that use Wordpress – but for backwards compatibility, the function continues to have this quirk.

A quick fix is to use this instead:

<?= get_the_date() ?>