Regarding answer provided by birgirethis to this post: wp-query-to-show-post-from-a-category-or-custom-field
I found one issue with your solution. The two inner joins (term_relationships and postmeta) will only get results when a specific post has at least one term_relationship entry, otherwise the query won't fetch that post and will get a faulty result. How do I modify the code to get the expected results?
Thanks!
INNER joins
used by the core here, try other types, likeLEFT
ones instead.