Skip Navigation

[Resolved] Customize random post filter with a timed schedule and repetition filter

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

Problem: I would like to use the "random order" feature to display a random post in a View. I would also like to be able to customize that randomization in two ways:
- Specify an amount of time that each random post should be displayed before the next random post is chosen
- Require all posts have been displayed randomly before any post is repeated, and then reset the randomization pool.

Solution: This type of randomization feature will require a significant amount of custom code. Right now Views offers these alternatives:
- Use start date and end date custom fields to define a time when each post can be "featured"
- Use a checkbox field to define a "featured" post and manage that manually each week
- Use a "featured" taxonomy term to define a "featured" post and manage that manually each week

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 1 reply, has 2 voices.

Last updated by Christian Cox 6 years, 7 months ago.

Assisted by: Christian Cox.

Author
Posts
#630346

I have two related questions:

First, I have several Views set up to display one random post (based on a custom post type) on reload of the page. However, ideally, I'd like to make the random post change on a timed schedule. Instead of every time the user reloads the page, I'd like the random post to change every week. Is there any way to do that?

Secondly, I assume that the random post is selected out of all the specified posts each time it reloads. Is there a way to eliminate any posts that have been previously shown until it has gon through the entire set of posts. For example, if the former is true, we could have a situation where a given post is displayed on week one and then again on week five because it has been put back into the pool of available posts to display at random. Thoughts?

hidden link
The example I currently have set up is on the last row of content on the page, where it says "Featured Term", "Featured Quote", "Featured Fact" and "Featured Thought".

#630368

Hi, an automated scheduling system that handles this for you will require a significant amount of custom code to set up, and I'm afraid that falls outside the scope of the support we provide here in the forums. If you'd like to connect with a skilled developer, we have a portal available here: https://toolset.com/contractors

The alternatives I can think of that you can accomplish in Views now:
- Use a custom field checkbox or a custom taxonomy term to designate "Is featured" for each post type. At the beginning of the week, manage this setting manually by removing the "Is featured" checkbox or term, adding it to a new featured post.
- Use a custom field start date and end date to schedule a time when each post will be "featured".