Wordpress Random Posts – get_posts() function
Wordpress Random posts
Display a list of posts selected randomly by using the get_posts() function for the orderby parameter value:
<h2>Random Post</h2>
<ul>
<?php $rand_posts = get_posts('numberposts=10&orderby=rand'); ?>
<?php foreach( $rand_posts as $post ) : ?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
Categories: Blogs, Bookmarks, PhP, Tech, Wordpress Random Posts, Wordpress, wordpress get_posts, Wordpress Random








