How to make WordPress print the date every time

If you are using the template function the_date or get_the_date while listing posts you might notice that the date doesn’t get printed every time.

This is because the previous day is stored so that it doesn’t print the date stamp more than once.

A simple work around is to simply use the function the_time instead, or by resetting the $previousday variable with a filter.

function mytheme_the_date($date){
global $previousday;

$previousday = null;

return $date;
add_filter( 'the_date', 'mytheme_the_date' );

Even though I would recommend the first alternative it is good to know why the date doesn’t appear!


Web Developer @ Oakwood Creative -

Tagged with: , ,
Posted in Beginner

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


WordPress Quick Tips is a blog supplying great tips about WordPress.

We hope to create a great knowledge resource for WordPress developers as well as serving a reminder for all the forgetful ones.

The blog is created and run by Vincent of Oakwood Creative

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 121 other followers

%d bloggers like this: