Use publish date instead of current date to retrieve a range of posts?
-
I’d like to create a separate category of posts where I can just publish “A year ago on…” type posts that will dynamically retrieve a list of posts within a date range relative to the date the post is published.
Essentially I would publish a post with just a title and when placed in that category, the loop builds the list of posts from the same week as the publish date, but from one year or two years ago, etc.
I have some general code in the single.php that filters out posts in the right category, but it seems I can only pull in posts relative to today’s date and not the publish date of that a particular post. And ideas how to make the date range relative to the publish date and not the current day?
I can build the loop – I just don’t know how to manipulate the dates. Any help would be appreciated.
- The topic ‘Use publish date instead of current date to retrieve a range of posts?’ is closed to new replies.