我目前在父页ID 43下有两个子页。客户证明。。无论如何我在查询$args中有随机顺序,但顺序从未改变。我会错过什么?
wp_reset_query();
$args=array(
\'post_parent\' => 43,
\'post_type\' => \'page\',
\'post_status\' => \'publish\',
\'posts_per_page\' => 2,
\'orderby\'=>\'rand\'
);
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
while ($my_query->have_posts()) : $my_query->the_post();
?>
<h4><? echo get_post_meta($post->ID,\'subtitle\', true);?></h4>
<p><? echo get_the_excerpt(); ?></p>
<?
endwhile;
}
wp_reset_query(); // Restore global post data stomped by the_post().