How to: Randomize posts order

February 2, 2009 at 8:00 am

Are you building a portfolio or a gallery with WordPress? If yes, it can be a good thing to randomize posts order, just like I did on the footer of theme to display WordPress themes. That’s very easy to do with WordPress: Just read on.

To randomize posts order, you’ll have to use the very powerful query_posts() function before your WordPress loop:

//Your loop goes here

Of course, it is also possible to randomize only a certain category:

//Your loop goes here