Any way to add orderby=random in a Looper Provider Query String? (To return a random set of posts/items)

Hello,

I have read through lots of looper query string posts and these types of looper query strings work great:

post_type=x-portfolio&posts_per_page=4&offset=0&ignore_sticky_posts=1&post__not_in%5B0%5D={{dc:post:id}}
(eg. to exclude the current portfolio item)

I’d love the 4 Portfolio Items (in the above example) that the looper provides to be a random 4 and not just the 4 most recent (by title, date or so on).
Is there a query string parameter and value for that?

Kind Regards
Simon

Hi Simon,

Thanks for reaching out.
You can add the rand option to the orderby attribute to get the post randomly. Your Query String will look like the following.

post_type=x-portfolio&posts_per_page=4&offset=0&ignore_sticky_posts=1&post__not_in%5B0%5D={{dc:post:id}}&orderby=rand

Hope it helps.
Thanks

Perfect you champion!

Great! Feel free to create a new thread if you need any other assistance.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.