I have a custom post type to display a single quote. Right now I have it set to random, but is it possible to have a WordPress loop that displays a random post but only changes once per day? So basically having a quote of the day post type. I see plugins for a quote of the day but these all pull from an external feed.
3 comments
Comments are closed.
Found a post scheduling plugin that let me recycle my quotes posts so that they can be randomized daily:
Auto Post Scheduler
Basically, I set the post schedule to 24 hours, set the post type to my custom post type, changed the eligible posts to published, checked randomize, and set the minimum age to 48 hours which I think should prevent the same post from being used two days in a row.
You can create your own. The only thing you need is a plugin that displays posts (like this one), then to make a formula to pick a random post each day and you can set this script to run once per day (usually those type of automations are triggered from visitors).
Useful links:
Function: get_posts
Function: wp_cron