0

I'm using the technique below for that (getting all the post related with a taxonomy term), but for some reason if I have some posts with the term e and post with the term English I get them all and not only those which are related to English.

 'tax_query' => array(
      array(
            'taxonomy' => 'origin',
            'field'    => 'name',
            'terms'    => 'English',

     )
 )

Is there a way to get all the post related with the English term only? I'm not sure but right now seems to be working as a like operator.

1 Answer 1

0

Try this:

'tax_query' => array(
  'origin' => 'English'
)

Also, it should be pretty easy. Do some research.

4
  • That doesn't work, I took a look into the wordpress reference but I don't see a reference for that. Commented Sep 15, 2016 at 14:42
  • this should work, use "english", instead of "English".
    – Deepak jha
    Commented Sep 15, 2016 at 14:49
  • Thanks, but I'm still getting the same results as the other way I was doing it. Commented Sep 15, 2016 at 15:01
  • can you post whole taxonomy query you used?
    – Deepak jha
    Commented Sep 15, 2016 at 15:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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