Support » Fixing WordPress » Random post order

  • Resolved pshero


    Hey Gang!
    I just need a bit of PHP help. On my site I’d like to be able to randomize the order in which posts are displayed. That way visitors to my homepage will be presented with lessons that maybe they haven’t seen before. I’m crap at writing my own PHP and have searched all over for a code snippet that would do the trick but to no avail. I’m sure this isn’t rocket science, all I want to do is randomize the posts.

    Thanks in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • stvwlf



    I’ve not tried this myself but give it a shot.

    In your index.php, add this before the WP loop

    <?php query_posts($query_string . '&orderby=rand') ?>



    STVWLF, Thanks a million, that did the trick perfectly!

    Fantastic! Been searching for this everywhere!!! 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Random post order’ is closed to new replies.