Way to display “Yesterday”, “Today”

I currently use the following code below in my loop to display dates for groups of posts. Works great, was just wondering if it’s possible to change the day from php code ‘l'(Sunday-Saturday) to Today and Yesterday for the current posts.

I am guessing WordPress doesn’t have a built-in detection and a function will need to be created to replace the date here?

$my_date = the_date(‘l, F jS, Y’, ‘<div class=”clear”></div><h2>’, ‘</h2>’, FALSE); echo $my_date;

Read more here:: Way to display “Yesterday”, “Today”

Leave a Reply

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