Kukyideas – thanks so much for this! I was looking for something very similar to allow me to switch out my sidebars and I was able to use your code for that.
Anyone else wanted to do the same.. here’s what i did using Cutline theme with a left sidebar to switch over a five-day period).
First, make 5 copies of your l_sidebar.php file.
Rename each one, l_sidebar_mo.php for Monday’s version, l_sidebar_tu.php for Tuesday’s version, and so on.
In your index.php, single.php and archive.php files, replace
<?php include (TEMPLATEPATH . ‘/l_sidebar.php’); ?>
with
<?php $sidebar = get_the_time(‘nj’); ?>
<?php if ($sidebar == 1015){ ?>
<?php include (TEMPLATEPATH . ‘/l_sidebar_mo.php’); ?>
<?php } else if ($sidebar == 1016) { ?>
<?php include (TEMPLATEPATH . ‘/l_sidebar_tu.php’); ?>
<?php } else if ($sidebar == 1017) { ?>
<?php include (TEMPLATEPATH . ‘/l_sidebar_we.php’); ?>
<?php } else if ($sidebar == 1018) { ?>
<?php include (TEMPLATEPATH . ‘/l_sidebar_th.php’); ?>
<?php } else if ($sidebar == 1019) { ?>
<?php include (TEMPLATEPATH . ‘/l_sidebar_fr.php’); ?>
<?php } else { ?>
<?php include (TEMPLATEPATH . ‘/l_sidebar.php’); ?>
<?php } ?>
Populate each sidebar with what you want to appear that day. (The days above are for a five-day window in October.)
If the post’s date doesn’t match any of the dates set, it will default to the regular l_sidebar.php.