I have been able to find docs on how to order by a custom date field, but I have a specific use case requested by a client: they have 100s of blog posts from 10 years of posting. They update their posts with new information constantly but their permalinks have a date structure so updating the post date isn’t an option without breaking external links and references to each post, and htaccess redirection is also not an option since it would require a lot of time to do and keep track of everytime they update content.
The solution I have come up with is to use ACF and create an “update_date” field that they can use to have the latest update date without messing with the post’s publish date. I know how to include posts in WP_Query by their post date OR custom field, which is great. The final piece of the puzzle is how to be able to query and order the posts by both fields as if they were the same parameter instead of 2 separate order parameters?
There isn’t a way to order by two different fields at the same time using WP_Query(). I’m not even sure that this could be done with a direct DB query. These are two different columns in two different tables. The only way I can think of to accomplish what you want would be to copy the original post date to the new update field for every post and then sort them only on the new field.