I can’t get the countdown to show actual “sleeps” per se. In other words.. I think you are defining sleeps as every 24 hours?? And as such, I have one event at 6pm on the 10th and one event the following morning at 8am yet they both show the same number of winks or sleeps.
if (!$showhours) {
$remain = ceil($remain / 86400);
And replace the $remain line with this:
$remain = floor($remain / 86400);
The two changes above should treat all dates as if they occur at midnight the same day, while still displaying them as the correct time:
In other words, suppose your event was on a Sunday at 8pm. On Saturday at 11pm, it says “1 day remaining”. On Sunday at 12:01am it will display “0 days remaining”.
If you also want to have hourly and minute countdowns, then it gets more complicated with a bit more tweaking…