Update: I am an idiot, but still have a problem. The code worked because I, coincidentally, added the two upcoming memorials on the same day I added the short codes, and the date_query works on post date by default. So all memorials added before today were past events, and all memorials added after yesterday were upcoming. That answers both questions below.
But I still don’t have a dynamic query working. Adding either of the below to the first query, in hopes of finding only upcoming memorials, gets zero results:
date_query_column=”date-start” date_query_after=”2022-10-05″
OR
date_column=”date-start” date_query_after=”yesterday”
How do I fix?
End update
___________________
We show memorials as event posttypes on the website, organized by date-start.
I wanted to list upcoming memorials (today or later) listed ascending (from today forward) and then list recent memorials (before today) in descending order (from yesterday into the past).
I strongly believe I got it working with the shortcodes below, about five days ago. However, checking the page today (since kluged), I saw that the first query yielded no events, when it should have yielded two, and the second query yielded all four. Changing “today” to 2022-10-06 and “yesterday” to 2022-10-05 did not make a difference.
I have since “duct-taped” the page by adding “recent” and “upcoming” to the event taxonomy, and relying entirely on a taxonomy search, so the page looks right. But I’d prefer a more dynamic solution.
Two puzzles:
1. Why doesn’t the code below work?
2. Why did it work a few days ago, and not today?
- This topic was modified 36 minutes ago by .
The page I need help with: [log in to see the link]