您可以像这样使用exclude。
$posts = get_posts( array( \'numberposts\' => -1,
\'exclude\' => array(\'post_id_1\', \'post_id_2\'),
\'post_type\' => \'post_type\',
\'orderby\' => \'meta_value_num\',
\'meta_key\' => \'post_meta_key\',
\'order\' => \'DESC\',
\'tax_query\' => array(\'relation\'=> \'OR\',
array( \'taxonomy\' => \'taxonomy_1\',
\'field\' => \'id\',
\'terms\' => \'taxonomy_id_1\'
)),
array( \'taxonomy\' => \'taxonomy_id_2\',
\'field\' => \'id\',
\'terms\' => \'taxonomy_id_2\'
)),
\'meta_query\' => array(array( \'key\' => \'meta_key\',
\'value\' => \'meta_value\'
))
)
);
如果要在“meta\\u query”中使用关系,请编写与在“tax\\u query”中编写相同的代码。
您还可以使用“wp\\u query”而不是“get\\u posts”。