Resolving a Variable Issue Date
-
I need every post on a site to be prefaced with the date as though it were published on Friday, even though it’s not. It can be safely assumed that the post in question would never be published on any day other than Wednesday, Thursday, or Friday.
Basically, whatever date the article is published, unless it’s a Friday, the algorithm will look for the Friday that comes after the publishing date of a post, and store that in a variable that can be echoed.
Let’s say it starts with the following:
$publishdate = the_date ('l, F j, Y', false);
$publishday = explode (' ', $publishdate);
if $publishday[0] = "Friday" : echo $publishdate;
Here’s where it gets a lot more messy, at least with straightforward code, especially when the month changes between Wednesday/Thursday and Friday. Is there a function in WordPress for just adding to a given date?
- The topic ‘Resolving a Variable Issue Date’ is closed to new replies.