I have a wordpress site, which has post and custom taxonomy. I want all post of a particular taxonomy with like query.

For example: Table: wp_post post_id 100

Table: term_relationship post_id term_taxonomy_id 100 154

Table: term_taxonomy id term_id taxonomy 154 155 business_listing

Table: term id name slug 155 Basket basket

I want all the post of Basket term in wordpress. enter image description here

  • Hi @Rajiv, welcome to WPSE! In order to better answer your question, please update it with what you've tried already and what errors or messages you're getting when you try what you have now. Narrowing down a question to a single issue will help us point you in the right direction instead of having to guess what you mean and going off on a tangent. – Morgan Estes Jun 10 '16 at 14:58
  • Thanks for response. Please check image now with above script. I can fetch all taxomony and there posts but I want like query in taxonomy – Rajiv Jun 10 '16 at 15:09

'LIKE' isn't supported by the current version of WP_Tax_Query, so you'll need to write a custom query. This answer from a couple of years ago still seems to be the best approach: https://wordpress.stackexchange.com/a/133805/26317.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.