在wordpress中,我有一个查询特定帖子的查询。
<div id="container-">
<?php
query_posts( array( 'post__in' => array( 53,51,46,44,42,40,34,30,28) ) );
$divname=1;
while (have_posts()) : the_post();
?>
<div id="outdiv<?php echo $divname ?>">
<div id="div<?php echo $divname ?>">
<?php the_content();?>
</div>
</div>
<?php
$divname ++;
endwhile;
?>
</div>
我希望它按顺序输出我想要的帖子,即帖子53,51,46,44,42,40,34,30,28
因为它是随机输出的,所以帖子包含图像和文本。我的问题是,这可能吗?还是<?php the_content()?>
没有按照正确的顺序发布帖子?还是HTML?请帮忙?
query_posts( array( 'post__in' => array( 53,51,46,44,42,40,34,30,28),
'orderby' => 'ID',
'order' => 'DESC' ) );
MySQL不关心查询的in语句中元素的顺序。