$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 );
SO网友:Bikash Waiba
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 );