0

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!

2
  • This is the "nature" of INNER joins used by the core here, try other types, like LEFT ones instead.
    – birgire
    Commented Jun 10, 2015 at 7:53
  • Thank you birgire! How do I mark this as answered??
    – user74413
    Commented Jun 14, 2015 at 6:14

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.