我使用以下代码从ID为的帖子中提取附加图像:
$args = array(
\'post_type\' => \'attachment\',
\'post_parent\' => $product_id,
\'post_mime_type\' => \'image\',
\'orderby\' => \'menu_order\',
\'order\' => \'ASC\',
\'numberposts\' => -1
);
$attachments = get_posts($args);
问题是上面的代码返回了所有附加文件。有没有办法从结果中删除特色图像?我不介意通过$args查询、一些if语句或过滤$attachments数组来完成。善良的regardsMerianos Nikos