$the_category_id = 10;
$new_posts = new WP_Query( array(
\'post_type\' => \'post\',
\'post_status\' => \'publish\',
\'tax_query\' => array(
array(
\'taxonomy\' => \'category\',
\'terms\' => array( $the_category_id ),
\'field\' => \'term_id\',
\'operator\' => \'AND\',
\'include_children\' => false
)
)
) );
所以基本上区别在于
include_children
参数