我想在页面上显示一些帖子,所以当我使用 wp_query() 如下一个和最后一个不输出任何内容时,为什么?
<?php
$my_query = new WP_Query('showposts=1');
while ($my_query->have_posts()) : $my_query->the_post();
?>
<li>.....</li>
<?php endwhile; ?>
<?php
$query = new WP_Query( array( 'post__not_in' => get_option( 'sticky_posts' ) ) );
while ($query->have_posts()) : $query->the_post();
?>
<li>.....</li>
<?php endwhile; ?>
<?php
$query = new WP_Query( array ( 'orderby' => 'rand', 'posts_per_page' => '1' ) );
while ($query->have_posts()) : $query->the_post();
?>
<li>.....</li>
<?php endwhile; ?>