orderby=rand doesn’t work ?
-
The code given in codex for tag get_posts() displaying random posts doesn’t work. It displays the post as if rand is non-existant.
<ul><li><h2>A random selection of my writing</h2> <ul> <?php $rand_posts = get_posts('numberposts=5&orderby=rand'); foreach( $rand_posts as $post ) : ?> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?php endforeach; ?> </ul> </li></ul>
Any ideas ?
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘orderby=rand doesn’t work ?’ is closed to new replies.