WordPress Code Reference

WordPress Code Reference

WordPress Code Reference is a website thats describes core functios, classes, methods, hooks as well as the various core APIs for using WordPress. It also provides a reference list of new items added in each version of WordPress.

the_Date() Function

the_Date() function displays the date the post was written. It will only show the date once for multiple posts published on the same day.

the_Date() Format Parameters

  1. $format PHP date format. Defaults 'date_format' option
  2. $before Output before the date
  3. $after Output after the date
  4. $display Whether to echo the date or return it

Summary

the_date() function will only show the date of the first post of the loop. It happens because in early days of blogging on WordPress posts were listed like a diary and grouped under one date. There are two ways to fix this problem: to use the_time() or to use get_the_date().