Add 20yrs to post date, and then query
-
Hi,
I would like to know if anyone knows a way of adding a timeframe (say 20 years) to the datestamp on a set of posts, and then running a query on the loop which uses the new date?
Basically what I want to do is have a series of normal news posts. In addition to that, I have a custom post type for ’20 years ago today’, with the posts in that date stamped appropriately in the early 90s. I’d like for those posts to appear in the same loop as the news posts (rather than in a separate loop).
So it might go:
* News Post (21 March 2012)
* News Post (19 March 2012)
* 20 years ago (17 March 1992)
* News Post (12 March 2012)
* 20 years ago (6 March 1992)and so on. And anything that happened less than 20 years ago (say, in 1993), would behave like a pending post, and not show up.
Any suggestions would be appreciated
- The topic ‘Add 20yrs to post date, and then query’ is closed to new replies.