Skip Navigation

[Resolved] Selecting and displaying a random post in a view

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to choose one random post and show the results in a View.

Solution:
Create a View, choose random order and set a post limit of 1.

This support ticket is created 6 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 replies, has 2 voices.

Last updated by josephQ 6 years, 7 months ago.

Assisted by: Christian Cox.

Author
Posts
#917521

Tell us what you are trying to do? I'd like to create a view that selects and displays a random post from among a group of posts. Is that possible? For example, I have a list of Alumni, and whenever the page loads, I'd like to display one random Alumna/us.

Is there any documentation that you are following? No.

Is there a similar example that we can see? No.

What is the link to your site? (There's no webpage to demonstrate the question.)

#917618
Screen Shot 2018-06-25 at 2.31.17 PM.png

Hi, here's how I would do this:
1. Create a View that shows all the Alumni you want to include in the random results.
2. In the View editor screen, choose "Random order" in the Ordering section and choose to display only 1 item in the Limit and Offset section.
3. If you cannot see these options in the View editor, enable them by scrolling to the top of the page and clicking "Screen Options".

#917655

That'll work perfectly, thanks!