我需要显示从我的WordPress主页上的约300个帖子只有1个随机文章。当我按刷新时,有时相同的帖子出现两次或很快在其他刷新后出现。我可以实现iTunes shuffle模式吗?我现在使用此代码:选择一个随机文章没有重复
<?php
$args = array('numberposts' => 1, 'orderby' => 'rand');
$rand_posts = get_posts($args);
foreach($rand_posts as $post) :
?>
<?php the_title(); ?>
<?php endforeach; ?>
不错的问题,现在我有一个*真正的随机*代码来处理播放列表;) – brasofilo