Could we use a plugin for this?
CSS Naked Day plugin:
download plugin | view source
To install, download css-naked.day.php, upload file to your plugin directory (wp-content/plugins/), and activate CSS Naked Day under Plugins in your WordPress installation.
Notes:
Plugin automatically “turns off” stylesheet in themes using bloginfo('stylesheet_url')
to call style.css.
For themes doing something else to load a stylesheet or ones calling additional stylesheets, use the plugin’s is_Naked_Day() conditional function for testing in your templates. Examples:
<?php if(!is_Naked_Day()) : ?>
<link rel="stylesheet" type="text/css" href="/css/your_style_sheet.css" />
<?php endif; ?>
-----
<?php if (is_Naked_Day()) { ?>
<!-- It's Naked Day didn't ya know it See
https://naked.dustindiaz.com for more
information -->
<?php } else { ?>
<style type="text/css">
<!--
@import"/css/your_style_sheet.css";
-->
</style>
<?php } ?>
-----
Finally, the plugin takes account of your GMT offset (Options > General, Date and Time ‘differ by’) when evaluating date/time. If you don’t want or need this, locate $use_gmt_offset
in the is_Naked_Day() function, and set its value to 0
(false).