WordPress.org

Forums

[resolved] How to randomize post order (4 posts)

  1. Benjamin_SP
    Member
    Posted 5 years ago #

    Hi everyone,

    Right now, My posts are ordered according to their publish date (the latest posts appearing at the top and the earlier ones at the bottom). I really want the posts to appear randomly, with each page refresh the order of the posts in the archives should be different. Can this be done?

    Many thanks.

  2. ClaytonJames
    Member
    Posted 5 years ago #

  3. esmi
    Forum Moderator
    Posted 5 years ago #

    <?php query_posts('orderby=rand');?> ?

    http://codex.wordpress.org/Template_Tags/query_posts

  4. Benjamin_SP
    Member
    Posted 5 years ago #

    Thank you very much to both of you. This snippet did it:

    <?php query_posts('orderby=rand');?>

Topic Closed

This topic has been closed to new replies.

About this Topic