0815

Du musst dich anmelden um Beiträge und Themen zu erstellen. Einloggen · Registrieren

Display a Custom Message on a Specific Date

Using a snippet of PHP, we can display a custom message (or any code, markup, or content) on a specific date:

<?php
if ((date('m') == 4) && (date('d') == 9)) { ?>

	<p>Today is <a href="http://naked.dustindiaz.com/">CSS Naked Day</a>!</p>

<?php } ?>

You could even use this technique to join in on CSS Naked Day by removing your stylesheet on that day. Simply wrap your CSS <link> as follows:

<?php // strip for CSS Naked Day
if ((date('m') !== 4) && (date('d') !== 9)) { ?>

<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />

<?php } ?>

The possibilities are endless!




0