Changing my navigation based on date

I would like my site to display different seasonal projects based on the date. Currently, I call the ‘Top Winter Projects’ section of my right navigation with the following code:

<?php include (TEMPLATEPATH . '/stub_favorites.php'); ?>

Is there a way that I could use a php include based on date? So if its January 14, call /stub_favorites.php, but if its March 10, call stub_favorites1.php? I’m new to php so bear with me.

Read More

My website is as followed: http://www.merrimentdesign.com

Related posts

Leave a Reply

2 comments

  1. The most dead easy way to display one include per month:

    <?php
       $filename = "month".date("n").".php";
       if (file_exists($filename)) include($filename);
    

    then add files:

    month1.php
    month2.php
    month3.php
    

    the right file will be included for each month. The script will fail silently if a month does not exist. To make this work for calendar weeks instead, use date("W");. A full reference of date parameters can be found in the manual.