WordPress display the posted date

I display a list of my recently posted custom posts. However i would like to display when it was posted with the get_the_date() function.

I would like the date to be displayed like this.

If it is posted today: just the time it was posted (18:24)

If it was posted this year: The day + month (22 may)

If it was posted before the current year: The normal date (2016-10-11)

Is this possible to do?

Thanks in advance! /Molle

Read more here: WordPress display the posted date

Leave a Reply

Your email address will not be published. Required fields are marked *