我不确定在Wordpress中的单个查询中是否可以做到这一点。您可以将其分为两部分,如下所示:
<ul>
<?php
global $post;
// Get posts by selected post ids
$args = array(
\'posts_per_page\' => -1,
\'post__in\' => [12345,12543],
\'orderby\' => \'post__in\'
);
$myposts = get_posts($args);
foreach ($myposts as $post) : setup_postdata($post); ?>
<li>
<?php echo get_the_ID(); ?>
</li>
<?php endforeach;
wp_reset_postdata();
// Get latest posts excluding selected post ids
$args = array(
\'posts_per_page\' => -1,
\'exclude\' => [12345,12543]
);
$myposts = get_posts($args);
foreach ($myposts as $post) : setup_postdata($post); ?>
<li>
<?php echo get_the_ID(); ?>
</li>
<?php endforeach;
wp_reset_postdata();
?>
</ul>