Incorrect taxonomy ID assigned to post with custom query
For anyone visiting this topic in the future, I will form an answer of my comment. The reason for this issue was the use of $category inside the tax_query. The get_terms function return terms as entire objects by default. The tax_query expects an ID (or an array of IDs). This caused issues with the execution … Read more