$args = array(
'post_type' => 'videolesson',
'ordeby' => 'rand',
'order' => 'DESC',
'posts_per_page' => 8,
'tax_query' => array(
array(
'taxonomy' => 'level',
'field' => 'slug',
'terms' => 'beginner',
'operator' => 'IN',
array(
'taxonomy' => 'vidsubjects',
'operator' => 'EXISTS'
),
),
),
);
$getting = new WP_Query( $args );
1 Answer
try this..
$args = array(
'post_type' => 'videolesson',
'ordeby' => 'rand',
'order' => 'DESC',
'posts_per_page' => 8,
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'level',
'field' => 'slug',
'terms' => 'beginner',
'compare' => 'IN',
),
array(
'taxonomy' => 'subjects',
'operator' => 'EXISTS'
)
),
);
$getting = new WP_Query( $args );
-
i don't know if that works similarly or not but what i did here is take an array one level out Commented Jun 21, 2017 at 14:21
-
I need get posts type = videos, your taxonomies in case tax = beginner for differect tax = subjects. @Howdy_McGee Commented Jun 23, 2017 at 13:36
orderby
. I would also question why a random ordering would be descending, random has no order