$query_args = array(
        'cat' => $lesson_id,
        'meta_value' => $lesson_type,
        'post__not_in' => array($current_post_id),
        'tax_query' => array(
                'taxonomy' => 'series',
                'field' => 'id',
                'terms' => $series_id,
                'operator' => 'NOT IN'


I'm trying to exclude posts tagged with a series id in the series custom taxonomy, but it's not working. What's wrong with the code?


The 'field' => 'id' is not valid.

Try 'field' => 'term_id' instead.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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