I'm trying to show expired posts AFTER non-expired posts. How can I do this?
I've added a custom field "Expiration Date", in which I store the expiration dates in yyyy/mm/dd format. Problem is, if I order my results by this field, future expiry dates come first.
So I created a repeating cron-job which compares the dates and creates a secondary custom field "Expiration Date Passed" for posts whose dates have passed. I tried ordering by this field, but WP only shows posts with a value for this field - IE posts with no expiry date, or expiry dates in the future, don't show. So I tried auto-adding values '99999999' for any post which haven't expired yet. Problem is, WP can't order by custom field values THEN date- IE the first posts with value '99999999' are in a random order.
I also tried doing two queries for posts, one without expired posts, one with, then merging these two arrays. So the data is in the right order - but it screwed up WP's pagination.
Help, I'm running out of ideas!