我用wordpress调用随机文章,下面的代码每次打开页面,随机文章都不一样,我想让文章产生的随机文章一次性随机生成后就不再变化了,请高手们帮我修改一下代码,好吗?万分感谢!代码如下:
<?php $post_num = 4;
$exclude_id = $post->ID;
$posttags = get_the_tags();
$i = 0;
if ($posttags) {
$tags = '';
foreach ($posttags as $tag) $tags .= $tag->term_id . ',';
$args = array('post_status' => 'publish',
'tag__in' => explode(',', $tags),
'post__not_in' => explode(',', $exclude_id),
'ignore_sticky_posts' => 1,
'orderby' => 'rand',
'posts_per_page' => $post_num,
); query_posts($args);
while (have_posts()) { the_post(); ?>
<li>...</li>