Skip Navigation

[Resolved] Assign a different RANDOM custom post to a View every day

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.

This topic contains 2 replies, has 2 voices.

Last updated by gaborG 6 years, 3 months ago.

Assigned support staff: Beda.

Author
Posts
#329850
Slide contents.jpg

I would like to create a slider that will display 3 slides, on each a different type of content (see image).
The Latest post slide would display the latest post.
The Song of the day slide would display a RANDOM Song post type.
The Quote of the day slide would display a RANDOM Image post type which has a quote in its title.

How can I make these random, so that they will load a new one every day?
Thanks.

#329854

Thank you for contacting us here in the Support Forum

Random Ordering in Views can't be set by a "display Date" or similar

What you can do it s create 3 Views, each displaying the correct Custom post Type, random ordering in the "Ordering" settings in the View.
https://toolset.com/documentation/user-guides/views/

Limit the View outputs to one Item only, if you want one Item displayed only, or set a pagination with automatic transition if more than one Item should be displayed.
https://toolset.com/documentation/user-guides/views-pagination/

Include all 3 Views in a page, or Content Template, and style it with THML / CSS

If you want the Post Slider View to display the latest Post only, please set the "Ordering" to "post Date" "Descending" and limit the Views output to one item only.

Please let me know if you need further infos about this, and let me know if you have further questions regarding the issue mentioned in this Thread

Thank you for your patience.

#329860

I actually found your solution in earlier posts here on the forum, but that's not good for me. The Quote of the day should be a single quote for an entire day, no matter how many times do you refresh the page. Naturally we will have a limited number of songs and quotes - and the songs will grow much slower than the quotes. We don't want anyone to be able to listen to all available songs within 2 days simply by refreshing the page. If we offer one song every day, visitors know that they'll receive something new tomorrow, and they come back for it.

I've found some PHP codes here on the forum and on other places in the web to do daily randomization, but I don't understand them. I also found a Post of the day plugin but it is very limited, it would require a little tweaking. Best if I contact one of the consultants. Thanks anyway.