您可以使用rand作为orderby检查以下代码
$args = array(
\'posts_per_page\' => 5,
\'offset\' => 0,
\'category\' => \'\',
\'category_name\' => \'\',
\'orderby\' => \'post_date\',
\'order\' => \'rand\',
\'include\' => \'\',
\'exclude\' => \'\',
\'meta_key\' => \'\',
\'meta_value\' => \'\',
\'post_type\' => \'post\',
\'post_mime_type\' => \'\',
\'post_parent\' => \'\',
\'post_status\' => \'publish\',
\'suppress_filters\' => true
);
$myposts = get_posts( $args );