[wp-hackers] advanced taxonomy query include_children problem

Haluk Karamete halukkaramete at gmail.com
Tue Mar 5 00:51:08 UTC 2013


I got this query

Array
(
    [tax_query] => Array
        (
            [0] => Array
                (
                    [taxonomy] => category
                    [terms] => Array
                        (
                            [0] => featured
                            [1] => science // here, if I replace the term
"science" with the term "topics" (which happens to be the parent term of
"science"), I get 0 match.
                        )

                    [field] => slug
                    [operator] => AND
                )

        )

)

Isn't it that In advanced taxonomy queries like this the include_children
is supposed to be by default TRUE?
But even if I were to enforce the include_children as TRUE, results do not
change. There is something ging on here, I'm unable to see.

The fact of the matter is "topics" category got 0 posts on the dashboard's
"Categories" page too. That's because we use the "term" only as a place
holder for its children which are "science", "politics", "finance" and so
on.

I also tried the none advanced taxonomy route which is using
the 'category__and' => array('12','3'). No luck same thing. Can't get to
the children.


More information about the wp-hackers mailing list