Make your theme do cron for you.

Re: Make your theme do cron for you.

by Richard Oelmann -
Number of replies: 0
Picture of Core developers Picture of Plugin developers Picture of Testers

Firstly Andrew, as a 6 year old thread this topic would be referring to 1.x themes (1.7/1.8???)

But as things have moved on from there, very few webhosts now do not have cron jobs available for you to run on the server itself (and if you are hosting yourself adding a cron job to either a Linux or Windows server should be very straightforward), so why implement one which is theme specific and doesn't work if you change themes.

On a more general point, code which is identified as going in the header.html of an old 1.x theme would now go in the layout files (usually general.php/default.php etc.)and code designed for 1.x themes will not necessarily work on 2.x sites.

In this case, you would possibly have to put it into all of the layout files your theme uses? mmm not sure - if your site was being visited frequently enough you might get away with only putting it in the frontpage.php??? but then if your site is not visited (say a school site during the holidays) no cron job will be triggered at all.

I would suggest exploring other ways of triggering the cron jobs through your server or webhost rather than through the theme.

Richard