Querying a post by taxonomy parent exact and child LIKE
-
I have a custom post with a nested taxonomy. Is it possible, preferably through WP_Query, but even with sql if not, to get all posts that exactly match the parent taxonomy given, and LIKE match the child given?
For instance, my post is product_cpt. I have a description_ct that is parent/child. So descriptions can be (x means checked):
x-CATS
-x-Molly
-x-Patrick
-x-Pam
-Papi
x-DOGS
-Buster
-x-Pam
-Sally
x-PARROTS
-x-DollyI want to be able to search for products that only match CATS with children LIKE “Pa”. So it would only return a product that had CATS->Pam or CATS->Patrick selected. But not products with DOGS->Pam selected. And not products with PARROTS selected.
So it’s really important that I know the “Pa” is only searching for “Pa”‘s that fall under CATS, and not “Pa”‘s found anywhere else.
- The topic ‘Querying a post by taxonomy parent exact and child LIKE’ is closed to new replies.