我创建了一个名为predic
, 我正试图在这篇文章中的一篇文章中找到其他四篇来自同一自定义文章类型的随机文章。我使用了这个代码,但我一直收到我在4次相同的帖子。
<ul>
<?php
$rand_posts = get_posts(\'numberposts=4&orderby=rand\');
foreach( $rand_posts as $post ) :
?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>