This is both a "how do I?" and "how should I?" question, as I'm thinking of ways to achieve my goal but they seem rather messy, so I'm hoping there's a neater way.
Currently I have a custom post type, which has a custom taxonomy attached to it and uses a custom date field (like an "event date").
What I'd like to do is have a landing page for the post type, and somehow a combination of the following (ideally all grouped by month):
- View posts from custom post type, taxonomy term A, with event date in the future
- View posts from custom post type, taxonomy term A, with event date in the past
- View posts from custom post type, taxonomy term B, with event date in the future
- View posts from custom post type, taxonomy term B, with event date in the past
I'd prefer to avoid 4 pages, perhaps having a page that shows posts with event date in the current month, and navigation to go forward or backward a month.
I've got queries that compare the event date to the current date, distinguishing those in the future from those in the past, but I'm not sure a) how to display the current month with both forward and backward navigation, and b) how to group the posts by month (with the month name as a header).
I'm also unsure how to create the appropriate templates and link them together. I currently have an archive-{custom post type}.php template, but what other files would I need to create (if any), and assign URLs to them?
All advice appreciated. Thanks.