How do I get a Function in my functions.php to execute with a cron job?
When you use *nix cron to run a PHP file like that it won’t have WordPress loaded. You can load it manually, but a better method is to use WordPress’ own cron API. Schedule the event in your functions.php: if ( ! wp_next_scheduled( ‘expire_posts’ ) ) { wp_schedule_event( time(), ‘hourly’, ‘expire_posts’ ); } I’ve used … Read more