WP plugin: CSS Naked Day
Gotta love the various goofy “Day” things the Internet seems to go crazy for. In honor of Dustin Diaz’s idea to make every April 5th CSS Naked Day, I’m releasing a WordPress plugin for it.
Installation is simple: Download css-naked-day.php, upload the file to your wp-content/plugins/ directory, and activate CSS Naked Day under Plugins. The plugin will—all day on April 5th—automatically disable the stylesheet if your theme is using bloginfo(‘stylesheet_url’) to call the default style.css.
For themes doing something else to load a stylesheet, or for those calling additional stylesheets, you can use the plugin’s
is_Naked_Day() conditional function for testing in your templates. Here are a few examples of how you can use it in your “header” template:
<?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 don't ya know! See http://naked.dustindiaz.com for more information. //-->
<?php else : ?>
<? endif; ?>
Finally, the plugin makes use of your blog’s 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). However, I recommend leaving it on, as it keeps April 5th “local” to you.
Now, start getting naked!