Random Post Order: How To Display Your Posts In A Random Order

Steven4 responsesWordPress

There are several reasons why you could want to display your WordPress blog posts in a random order… It could be because you are building your portfolio, a CSS gallery, a Flash Games website, a Video Website… Displaying your WordPress blog posts in a random order is a very simple trick to achieve.

If you want to randomize posts order on your homepage, you must edit your index.php theme file.

Search for:

if (have_posts()) :

Learn how I made $33,543 online in the past 12 months.

Simply input your best email below to get started.

And replace it with:

query_posts('orderby=rand');
if (have_posts()) :

You might also want to randomize posts in your category archives. If that’s the case, you must edit your archive.php file (the steps are the same as above).

Learn how I made $33,543 online in the past 12 months.

Simply input your best email below to get started.

4 Comments

  1. Pt

    It worked, but now put my posts on every page…can you maybe include a screen shot before and after..thanks!

    1. You can’t really use random order and pagination together. You will see the same posts on different pages.

  2. All Of Themes

    Short tip but really really helpful . I will try on my page and i will tell you if help me out! I have been searching this long time ago . You save me 2 days searching thru internet! Thanks dude! :)))

  3. Aldo

    Thank you so much! :)

Learn how I made $33,543 online in the past 12 months.

Simply input your best email below to get started.

No thanks, I have enough money