More Dates in WordPress

creative commons licensed ( BY ) flickr photo shared by peacay As I continue to mess around with time/calendaring in WordPress I thought it’d be helpful to be able to allow users to add specific events1 to the calendar service of their choice. That led me to the addthisevent.com javascript. It allows the user to choose the calendar format of their choice from a variety of options plus it’s free for non-profits and schools. Initially, I just threw a script link in the footer of my Time child theme but that’s not really how you’re supposed to do things in WordPress Land and it meant that a pretty useful action would be restricted to that single theme. There are also some people in the AddThisEvent comments requesting WordPress plugins. Since I’m wandering around the borders of Programistan anyway, I figured I’d write a plugin. This may be beating a dead horse in terms of detail but I’m hoping it might help other people who aren’t programmers get things done. Version 1 The first version was as barebones as you can get. It does via plugin what I did previously via the theme – stick the addthisevent script in the footer. I referenced the WP wp_enqueue_script2 page in the codex to do this. You can see it commented up below. Version […]

Dating WordPress

This post is going to attempt to document how I figured out how to mess with dates in WordPress custom fields. I don’t know how widely valuable that is but a number of the concepts are probably broadly applicable. This particular discussion will wander into areas of programistan and there is one child theme page involved.1 It’s live and working (although it may occasionally be down when I do something odd and it’s ugly as sin at the moment) but feel free to look around or add some fake events. Getting all posts with a custom field named ‘event’ to show on the front page was discussed here. I added a bit to the theme so that if there was more than one event on that day it’d display it with a different format. You can see the whole page on GitHub here. The other little chunk of code that might matter is what’s returned if there are no events on that day. It just tells you nothing is there and presents you with the events for the next seven days as defined by the FacetWP layout (which I’ll go over in a bit). Now that we had a decent way to see what was going on that day, I built the “Event Creator” form which will allow the instructor […]