Answer the question
In order to leave comments, you need to log in
The selection for a certain taxomy does not work?
Hello, I can't figure out what's wrong.
<?php $expert = new WP_Query(array(
'post_type' => 'expert',
'posts_per_page' => -1,
'orderby' => 'title',
'tax_query' => array(
'taxonomy' => 'categoryexpert',
'field' => 'id',
'terms' => array(6),
'operator' => 'IN',
),
)); ?>
Answer the question
In order to leave comments, you need to log in
tax_query is an array of arrays
<?php $expert = new WP_Query(array(
'post_type' => 'expert',
'posts_per_page' => -1,
'orderby' => 'title',
'tax_query' => array(
array(
'taxonomy' => 'categoryexpert',
'field' => 'id',
'terms' => array(6),
'operator' => 'IN',
)
)
)); ?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question