At the moment I have a really basic PHP script for randomly drawing quotes from a text file.
<?php include('testimonials.txt');
srand ((double) microtime() * 100000);
$random_number = rand(0,count($quotes)-1);
echo ($quotes[$random_number]);
?>
Of course currently the script executes every time the page loads and brings up new content each time the page is refreshed.
I want to know is there any easy way to modify this to change the content on a timer, so it only changes once a day, or every few days?
If it requires altering the wp-cron.php of my site, any idea what I would need to put in there to do so?
Thank you
You can start with something as basic as this, which saves the id of a quote and the time it was picked in a file:
There are several things that can be improved here (e.g. error handling, the possibility of the testimonials file changing in a way that makes the cached quote invalid, etc) but the basic idea should be apparent.