我有一个ID数组,我发送给query\\u posts以获取帖子(这很好),但它似乎总是把附件(562)放在最后,即使它是最新的。还尝试了title和ASC vs DESC,但它总是最后一个?
$slide_args = array(
\'post_type\' => \'attachment\',
\'post_status\' => \'inherit\',
\'fields\' => \'ids\',
\'tax_query\' => array(
array(
\'taxonomy\' => \'media_tag\',
\'terms\' => \'new-work\',
\'field\' => \'slug\',
)
)
);
$slide_attachments = new WP_Query($slide_args);
$sticky_ids = get_option(\'sticky_posts\');
$slideshow_posts = array_merge($slide_attachments->posts,$sticky_ids) ;
// creates Array ( [0] => 562 [1] => 479 [2] => 598 [3] => 686 )
// 562 is an attachment, the others are posts
$postsargs = array(
\'orderby\' => \'date\',
\'order\' => \'DESC\',
\'post_status\' => \'published\',
\'post_type\' => array( \'attachment\', \'post\' ),
\'post__in\' => $slideshow_posts,
);
query_posts( $postsargs );
有人知道会发生什么吗?最好的,Dc。