<?php
$rand_posts = get_posts('numberposts=5&orderby=rand');
foreach( $rand_posts as $post ) :
?>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php endforeach; ?>
bunu denedim fakat şöyle bir hata verdi:
WordPress veritabanı hatası: [Unknown column 'rand' in 'order clause']
SELECT DISTINCT * FROM wp_posts WHERE 1=1 AND post_type = 'post' AND post_status = 'publish' GROUP BY wp_posts.ID ORDER BY rand DESC LIMIT 0,5