I would like to write a PHP snippet that can communicate with Wordpress.
When a new post is published, a file today.jpg will be generated from the thumbnail url (a custom field) of the most recent post.
Or I can schedule a cronjob to execute daily for this action.
How can I implement this function?
My idea is to do it outside of functions.php so that it won't get executed all the time, while a scheduled update for today.jpg seems more resource friendly.
Any pointer is appreciated.