/** * @article External Events Calendar * Plugin for WordPress * * @since January 31, 2011 * @package Wordpress Plugins * * @comments 74 comments * */
As of WordPress 3.5, the Links Manager, which this plugin depends on, is hidden by default. If you are installing this plugin into a new WordPress install which does not have the Links Manager visible, you will need to install and activate the Links Manager plugin first.
I will be working on a new version of the plugin which does not depend on the Links Manager.
This plugin adds a basic “upcoming events” calendar to WordPress. This is different from most other events calendar plugin in that the events are stored as “links” rather than posts or custom post types. This is useful in cases where the “events” that need to be listed have their own sites, and you don’t need to store information about these listings beyond linking to them. It creates a new link category called “Events Calendar” with meta fields for location and date. It also creates a minimal configurable widget with option to display all events or only future events, show in ascending/descending order, and options to show or hide link images and descriptions. Useful for listing speaking engagements, upcoming social events, or other calendar listings which link outside of your site.
The Start Date and End Date fields are stored as text fields and can be entered as any standard php-readable date format (i.e. “Aug 1, 2010 5:00pm”, “10/4/11″, and “November 2012″ are all acceptable, and will be ordered properly and displayed just as they are entered). The End Date field is optional; if included, it will display the dates as a range; if not, only the first date will be displayed.
A note on non-American date formats:
According to the documentation on php.net regarding date formats, a number of European-style date formats should be parsable — including DD-MM-YYYY, d.m.yy, and roman numeral month indicators. However, tests under different server environments have shown this to be fairly unreliable. If you have a problem with your dates not being processed properly, try entering all dates in MM/DD/YYYY format and either using the localized WordPress date format setting or a custom date format (options added in version 0.4)
Styling the output
Styling is customizable through css: each field is given its own class. A basic stylesheet is included in the plugin, but you can choose on the plugin options page to ignore that file and use your own stylesheet to override. You can also copy the default stylesheet (
gad-events-calendar.css) either to your theme directory or a new directory called
/wp-content/plugins/gad-events-custom/ to preserve any changes you make against future plugin/theme upgrades.
“Current day behavior”
In previous versions of the plugin (prior to 0.4), there were issues where the current day’s events would not be displayed if a time wasn’t specified for the event. I suggested workarounds involving adding a time to the event listing or hacking the file to set the current timestamp back to “yesterday”, bu these were awkward and hackish solutions. With the current version, there is an option on the settings page to control the behavior of the current day’s events — options include “show all events from the current day” and “show all events from the current week”.
You can include a list of events in any Post or Page on your site. The shortcode allows the same options as you can select in the widget. Here is the syntax for each of the options:
display_title(false|string) The title, if any, to show before the list of events. Will be wrapped in an
<h2>tag if present.
show_past_events(true|false) Present for backwards compatability. Use
show_events("upcomingonly"|"allevents"|"pastonly") Pretty much what it implies. Defaults to “upcomingonly”.
show_descriptions(true|false) Whether or not to show descriptions in the list of events. Defaults to true.
show_images(true|false) Whether or not to show link images, if present, in the list of events. Defaults to false.
orderby(ASC|DESC) ASC: Order events current to future, or past to future. DESC: Order events future to current (or past). Defaults to ASC.
limit(int) If present, the maximum number of events to show in the listing.
link_category(int) A different category to pull events from, other than the default “Events Calendar” category. Accepts the ID of the link category to use.
In the wild
- See an example of the plugin in action on the home page of Enjoy Life Unschooling.
Anyone else using the plugin successfully? Let me know in the comments, or send me a link, and I’ll highlight it!
- Added “past only” option, to show only past events.
- New options for behavior of current date (can choose to have upcoming events drop off the calendar when the start date is past, when the end date is past, or to include all events from the current day, or week). This addresses a bug which was reported where events which weren’t given a time would drop off of the calendar on the day they were scheduled.
- Fixed bug within shortcode that would always display at the top of post content.
- Added custom date formatting option using any PHP date format string.
- Removed deprecated functions
- Added support for short code
- Added ‘limit’ feature to limit the number of events which appear in widget or shortcode.
- Added settings page and submenu page under “Links” menu to manage events.
- Added the option to use WordPress date format setting
- Fixed bug where if two events with the same starting date were added, only one would show
- Fixed markup bug which left an unclosed div if no events were displayed
- Improved internationalization – now everything should be translatable except the category name “Events Calendar”
- Beautified the code, so you won’t be ashamed to take it home to your mama
- Fixed bug where custom meta did not save properly on adding new link, only when editing existing link.
- Previously, the custom fields metabox was only available once links had been added to the “Events Calendar” category – so you had to create a link & assign it to that category, then go back and edit it to access the custom fields. The metabox is now available to all links, regardless of category.
- Improved regular expression processing of date ranges (i.e. ranges of dates will now show as “May 27–30, 2010″ or “June 26–July 1, 2010″; not “May 27, 2010 – May 30, 2010″ or “June 26, 2010 – July 1, 2010″).
- Added option to display link images.