WordPress.org

Ready to get started?Download WordPress

Forums

Error with Random article (1 post)

  1. Anonymous
    Unregistered
    Posted 5 years ago #

    Hi there, I just upgraded to 2.6 and my random article generator just stopped working. It now shows my most recent post instead. Can anyone tell me how to fix it? The current code is below:

    <?php
    			 $rand_posts = get_posts('numberposts=1&orderby=RAND()');
    			 foreach ($rand_posts as $post) :
    				setup_postdata($post);
    			 ?>

    Thanks for any help you can give!

Topic Closed

This topic has been closed to new replies.

About this Topic