On Snowy Day Coding

There’s a new version of WordPress out today, and I’ll probably download it and upgrade this weekend. After the experience of moving to WordPress 2.8 — which wasn’t pleasant — I’m a little cautious.

The main issue with that upgrade — the WordPress memory bloat — was resolved in one of the bugfix releases. It’s still a massive piece of software, but that probably can’t be helped.

And, while I haven’t upgraded my WordPress install, I have spent my morning working with PHP code, and I cobbled together a WordPress plugin.

What I wanted was a different way of displaying archives. I wanted a calendar view for archives, much like LiveJournal does, where you can get a yearly calendar, with links on each day to posts for that day.

WordPress can do that, but only on a month-by-month basis.

I took one plugin, the Calendar Cloud Plugin, and I was able to merge that with a routine that called WordPress’ calendar code. I had to experiment, to figure out how to pass the get_calendar function the month and year; it’s not written in such a way that you can, but I discovered there was a way to trick it. Then, trial and error to figure out the right way to make the string for the “trick.”

And that worked. I had a table of monthly calendars. But that didn’t really work the way I wanted — it gave me “next” and “previous” links at the bottom of each month’s calendar. So I took the code for the get_calendar function, copied it into my plugin, renamed the function, and stripped out the code for the next and previous links.

That worked.

Then it was just a question of getting the calendars styled.

I like the final result. It does what I want, and it looks good.

Published by Allyn

A writer, editor, journalist, sometimes coder, occasional historian, and all-around scholar, Allyn Gibson is the writer for Diamond Comic Distributors' monthly PREVIEWS catalog, used by comic book shops and throughout the comics industry, and the editor for its monthly order forms. In his over ten years in the industry, Allyn has interviewed comics creators and pop culture celebrities, covered conventions, analyzed industry revenue trends, and written copy for comics, toys, and other pop culture merchandise. Allyn is also known for his short fiction (including the Star Trek story "Make-Believe,"the Doctor Who short story "The Spindle of Necessity," and the ReDeus story "The Ginger Kid"). Allyn has been blogging regularly with WordPress since 2004.

One thought on “On Snowy Day Coding

Leave a Reply to Allyn Cancel reply

Your email address will not be published. Required fields are marked *