Please provide your code if you’d like us to help you troubleshoot
YOu’re calling your code in the inappropriate way; you should be using a tax_query, not a meta query: https://codex.ww.wp.xz.cn/Class_Reference/WP_Query#Taxonomy_Parameters
you would be using ‘field’ instead of key,
field (string) – Select taxonomy term by. Possible values are ‘term_id’, ‘name’, ‘slug’ or ‘term_taxonomy_id’. Default value is ‘term_id’.
Also, if you’re using a relationship field to a taxonomy, that’s the inappropriate way to work with Taxonomies and WordPress. You should have your taxonomy associated to the post-types.
Thanx @jimtrue for reply. I want taxonomy as a dropdown so i am using relation field and i got field as a dropdown see “https://prnt.sc/nqrjpv“. Now i want to get selected term from that field. I tried using tax_query as you told me “https://prnt.sc/nqrjk3” if i select checkbox then i got result but not from dropdown . I want to get result from dropdown please suggest me any idea.
-
This reply was modified 7 years ago by
saiyyed.
If you want to change the display parameters of your Taxonomy, there are methods for that:
https://docs.pods.io/code-snippets/change-taxonomy-input-to-single-select/
You should never use a Taxonomy as a relationship field, because it won’t work in your queries properly.
You need to switch to an associated taxonomy and a tax_query as above and it will work properly.
Basically, by switching a taxonomy to a relationship field, you break all the inherent taxonomy abilities of that taxonomy. That’s what you don’t want to do; you just want to change how it’s displayed. That link above will give you the ability to change the way the taxonomy is hanled in the back-end UI, but still let it behave like a taxonomy.
Wow amazing thanq so much @jimtrue. that i got what i want and your taxonomy query is working fine and i have dropdown too “https://prnt.sc/nr8fad“.
-
This reply was modified 7 years ago by
saiyyed.