Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.
$query_args = array(
        'cat' => $lesson_id,
        'meta_value' => $lesson_type,
        'post__not_in' => array($current_post_id),
        'tax_query' => array(
            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?

share|improve this question

1 Answer 1

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

Try 'field' => 'term_id' instead.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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