WordPress 无插件调用随机文章的方法

<ul>

<?php
global $post;
$postid = $post->ID;
$args = array( 'orderby' => 'rand', 'post__not_in' => array($post->ID), 'showposts' => 10);
$query_posts = new WP_Query();
$query_posts->query($args);
?>
<?php while ($query_posts->have_posts()) : $query_posts->the_post(); ?>
<li><a href="<?php%20the_permalink();%20?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul>