WordPress – date vs. time

2013-01-15

Due to an old habit, I use the WordPress function the_date() in my template files. It’s been working fine so far and has displayed the date when the post is published in any format I chose. But apparently, In the case where several posts are published on the same date, it only displays the date for the first post in the group. All other posts for the same date have an empty date. To display the date for all posts in the loop, independent of its publication date, you can use the function the_time(). It doesn’t have all the options from the_date() except from a custom time format. It doesn’t have the before or after options that the_date() has. It can be helpful to keep this in mind when you’re developing a new WordPress theme. I just noticed this after a long time developing themes for WordPress.