I was on the train this morning, with some random woman watching every single thing I typed into the laptop when I noticed that the coding I had done late last night was actually accessing the database 30 odd times to get the posts for the calendar, inefficient to say the least.
I struggled for about 20 minutes trying to think of a more effective way of getting the data from the database only once. I finally worked it out, but it ended up changing the entire automated calendar script. It was probably for the best, but I’m yet to see the benefit’s clearly enough to warrant the work it took.
You can view the most up to date version of my code for the calendar here