I recently got sick of manually entering in the current date, and month for a personal (private) wordpress post that I use to keep basic details of what I’ve done for the day (computer exploded, Zombies attacked, met an awesome girl, etc..).
I actually hadn’t updated it for months because it was too much of a pain, so I wrote a PHP script that outputs the name of the month, the current date, and then an unordered list with some ‘-‘ place holders to stop WordPress from removing the the list.
Please note, that the script is pretty basic, and just shows the next 100 days.
For those that do know what PHP is, you’ll know that you need to actually get a web server (like Apache) to run it. The code is very basic, but shows the power of for loops, and the date, and time functions of PHP.
If you don’t know what PHP is, then don’t worry, just click on the Script button below, then you can copy and paste the contents into WordPress (or whatever blogging program your using), alternatively when you are looking at the script you can right click, and [view page source], or whatever your browse calls it, then copy the raw HTML, and paste that into your blogging program.
You can download the PHP code from http://www.kublermdk.com/web_widgets/Months.phps (then rename the extension to just .php)
The actual PHP code :