Update: Version 0.2 was released today (4/19/2009) which allows configuration of a timezone offset that can be customized to force start and end times from the XML feed to be displayed in the desired timezone (see documentation of the option below).
Update: I’ve added a screenshot of the plugin in action on a blog I administer. You can view it here.
Google Calendar Feed Parser is a WordPress Plugin designed to facilitate incorporating a Google Calendar XML feed into your WordPress blog. I wrote this plugin after being unable to find an existing plugin to provide similar functionality. I intend to keep this plugin up to date, compatible with the most recent releases of WordPress, as they occur. If you have suggestions, comments, advice, etc. or you would like to help me develop the plugin, feel free to leave a comment and I’ll get back to you. Any help is appreciated (especially since this is my first WordPress Plugin). Please let me know if you have any timezone related issues, I had some odd problems getting the times to appear properly.
To install Google Calendar Feed Parser:
- Download the zip archive and extract it to the wp-content/plugins directory.
- Go to the “Plugins” page in the WordPress Admin interface and click the “Activate” link for the Google Calendar Feed Parser.
To configure Google Calendar Feed Parser:
- Go to the “Settings” page in the WordPress Admin interface and click the link for the “Google Calendar” page.
- Set the URL for the calendar feed and other settings as desired (see below for full explanation of all options).
Options:
- Feed URL: This is the URL of the feed you wish to incorporate in your blog. It should be of the form:
http://www.google.com/calendar/feeds/userID/public/full?param=value¶m=value…
-
- For a listing of available parameters, see the Google Calendar API documentation. I found the following query string to provide desirable results:
?orderby=starttime&sortorder=ascending&futureevents=true&singleevents=true
- Note that the max-results parameter should not be specified here as it will be handled by the setting below.
- Static URL: Use this option if you want to have each event link to a single URL (e.g. have each event link to a page where you’ve embedded your Google Calendar). If you leave this set to “No”, the plugin will use the link provided by the feed for each individual event.
- Max Results: Use this to set the maximum number of events to retrieve and display from the calendar. If left blank, the plugin’s default is 4.
- Timezone Offset: Change this value only if you are having issues with times from the feed displaying correctly. The value supplied in this field is a number of seconds added directly to both the start time and the end time for each event. The default for this value, if left blank, is 7200 seconds. Note: In a future release of the plugin, this option will be replaced with a more comprehensive timezone customization feature.
To Use Google Calendar Feed Parser:
- Include a call to the function gcal_parse_feed() at the spot where you want the feed to appear. I use the feed in my sidebar but you could use the feed wherever you want.
- Include style rules in your template’s stylesheet to customize the look of the feed. A single event outputted from the plugin would be of the form:
<div id=”events”> <div class=”event”> <h3><a href=”http://some-link-here”>Event Title</a></h3> <p id=”event_time”>July 12, 2009 from 9:00pm to 10:00pm</p> </div> …more events here… </div>
Donations:
If you like this plugin, please consider donating.
Changelog:
Version 0.1 (first):
- Ability to set feed URL.
- Choice of whether to use event URL from feed or static URL for each event.
- Ability to set max-results parameter.
Future Functionality:
- Ability to customize query string from the Admin interface in WordPress.