posts + categorie problem with child-child category
-
Hi.
I find a problem but didn’t have a solution. But i know now the problem and can solve it without child child categories.
The following problem with an example:
I have the categories:
AA (term_id: 1)
BB (term_id: 2)
-BBA (term_id: 3)
–BBAA (term_id: 4)
-BBB (term_id: 5)I have a post with Category “AA” and “BBA”
So now i will show with shortcodes ultimate posts which are in the category AA and BBA. Tax Operator is AND.
Result: No posts found.
It takes me a while but i found the problem.
The final query for seraching the term_id looks like this:
SELECT term_id FROM wp_XXXXX_term_taxonomy WHERE taxonomy = 'category' AND term_id IN (1,3,4)
The query wants to find posts with the child-child term_id: 4
So there is no post with the child-child term_id 4 and we have no results. If i delete the child-child category BBAA then then hole thing works. If you have more questions, please ask. I hope this report helps you and others to find a solution, if they ran into the same problem.
- The topic ‘posts + categorie problem with child-child category’ is closed to new replies.