Display random posts

By default Display Posts will show your posts ordered by publish date, with the newest first. You can use the orderby parameter to change this to any other ordering method.

To list random posts, use:

[display-posts orderby="rand"]

You can use the other query parameters along with this to pick from a smaller selection. For instance, if you wanted to show 5 random posts in the “featured” category:

[display-posts orderby="rand" category="featured" posts_per_page="5"]

You can even provide a list of specific posts to pick from. In the example below, we’re displaying one random post selected from the 4 Post IDs provided:

[display-posts orderby="rand" posts_per_page="1" id="12, 15, 17, 20"]

Published by Bill Erickson

Bill Erickson is a freelance WordPress developer and a contributor to the Genesis framework. For the past 14 years he has worked with attorneys, publishers, corporations, and non-profits, building custom websites tailored to their needs and goals.