Upcoming: CSS Naked Day
Announcement: April 5th will be the second CSS Naked Day.
Just like last year, a lot of bloggers and web developers will have fun on this day by disabling the CSS for their sites and see what the raw content looks like.
I just installed a plugin for WordPress which does CSS switching for me. Well, it did not quite work with the current 2.1x release of WordPress, so I made a slight modification.
This version of the plugin works for me in WordPress 2.1x:
<?php
/*
Plugin Name: CSS Naked Day
Plugin URI: http://guff.szub.net/2006/04/03/css-naked-day/
Description: Automatically turns off stylesheet on April 5.
Also provides is_naked_day() conditional for use in your templates.
Author: Kaf Oseo
Version: 1.0.2
Author URI: http://szub.net
For info on CSS Naked Day: http://www.dustindiaz.com/naked-day/
Copyright (c) 2006 Kaf Oseo (http://szub.net)
CSS Naked Day WordPress plugin is released under the GNU General
Public License (GPL) http://www.gnu.org/licenses/gpl.txt
Adapted for WordPress 2.1x by Johannes la Poutre
See http://squio.nl/blog/2007/04/03/upcoming-css-naked-day/
This is a WordPress plugin (http://wordpress.org).
*/
function time_to_get_naked($text) {
if(is_Naked_Day() && $text == get_bloginfo('stylesheet_url')) {
return;
}
return $text;
}
function is_Naked_Day() {
$use_gmt_offset = 1; // use GMT offset (Options > General, Date and Time 'differ')
$start = date('U', mktime(0,0,0,04,05,date(Y)));
$end = date('U', mktime(24,0,0,04,05,date(Y)));
$now = time('U');
if($use_gmt_offset) {
$offset = get_settings('gmt_offset')*60*60;
$start += $offset;
$end += $offset;
$now += $offset;
}
if (($now >= $start) && ($now <= $end))
return true;
else
return false;
}
add_filter('bloginfo_url', 'time_to_get_naked', 5);
?>
Just copy the content to a file named ‘css_naked_day.php‘, upload it to your wp-plugins directory, activate it from the Plugins menu and you should be ready.
Popularity: 32%
Tags: php, web developers
Permalink



Paul Enderson said,
April 3, 2007 @ 18:22
Thanks! I’ve got it installed, primed and ready for the 5th!
Paul @ GadgetBloke.com
Squio.blog » Reasons for stripping down said,
April 4, 2007 @ 11:02
[...] Now I’m using WordPress and, indeed, just installed a plugin for ‘Naked Day. OK, so my contribution was to adapt that plugin for WP 2.1.x. [...]
Night Dreaming (by Sudar) » CSS Naked day 07 said,
April 4, 2007 @ 19:18
[...] If even you want to participate then register your site in the official site and then strip the CSS from your site. If you are on WordPress then you can use this plugin. [...]
Paul Enderson said,
April 5, 2007 @ 01:39
Your plugin failed I’m afraid. I had it installed, seen by WP, with my layout conforming to Guff’s original recommendations.
Is it possible that it was geared up to something other than 12:01 GMT?
Thanks for the effort anyway. I just had to strip of manually! ;¬)
Paul @ GadgetBloke.com
Auke Visman said,
April 5, 2007 @ 16:45
It’s a shame I just found out that today is the ‘css naked day’. I’ve used the plug-in in my WP 2.1.3 and it works!
So I’m ready for next year and I hope to get comments on it as well.
Thanx!
Joe said,
April 5, 2007 @ 19:36
@Paul: the plugin *should* take into account your local time zone. However, you need to have specified what the time zone offset is in the WordPress settings for that to work. Go to Options in the admin interface, look under Date and Time and specify the value for “Times in the weblog should differ by: xx”.
I did not test this, though, as for me the time offset is very limited (ony two hours during daylight savings time).