Transit Custom Posts: A WordPress Plugin for Transit Sites

One of the remarkable things about an open data specification such as GTFS is that it finds itself in all kinds of places—from trip-planners and mapping applications to network planning software. Now, it has infiltrated website development thanks to a grant from ODOT through the Northwest Oregon Transit Alliance (NWOTA). We’re excited to announce the alpha release of the Transit Custom Posts plugin and an accompanying WordPress theme, leveraging GTFS data to help make transit websites cheaper to develop and easier to maintain.

This isn’t our first time at this particular rodeo; we’ve used GTFS data to help build websites for over a dozen agencies. However, this is the first time we’re releasing the result as open-source software. Both the plugin and template are completely free and available to download on Github. Not only that, but anyone is welcome to modify or improve the code, or take what we’ve made and build something of their own. The beauty of open source, much like open data, is that it removes the need to constantly reinvent the wheel.

It seemed like a natural fit to use WordPress as the base for these tools. Not only is it the world’s most popular CMS (content management system), it is also entirely open source. The flourishing network of WordPress users and active developers is ideal because this current plugin isn’t the end goal. We envision an ecosystem of transit-related themes and plugins that implement, complement, and augment what we’ve created.

Ultimately, what this means is better, more accessible transit technology for riders, and quality website development within the reach of even the smallest agencies.

So what exactly does this plugin do?

Glad you asked! Transit Custom Posts is built off the observation that nearly all transit agencies need some of the same types of custom content and need to implement some of the same processes. Namely, most agencies have routes, timetables, and service alerts, and occasionally need to update their GTFS data (which may affect both their routes and timetables).

Routes have standardized attributes because they are part of the GTFS data. The plugin takes advantage of this fact by automatically creating route posts from a live GTFS feed and attaching GTFS information such as color, long name, short name, and description. For a system with dozens of routes, this can save hours of work. Plus, it guarantees consistency with the live feed.

Timetables are not represented directly in the GTFS, but can be inferred from it. Remember how I mentioned that the beauty of open source is not needing to reinvent the wheel? It just so happens that there is already a great application for creating timetables from GTFS called GTFS-to-HTML, so we don’t attempt to duplicate that work. Instead, Transit Custom Posts is compatible with the timetables.txt file used by GTFS-to-HTML and can automatically create timetable posts in WordPress and easily include them in a theme with a single line of code.

Alerts are a necessary part of any real transit system, and though they aren’t represented in the GTFS data, they benefit from the other programmatically generated content. The plugin allows alerts to be easily generated from the standard WordPress admin area, associated with one or more routes (pulled directly from the route data), and given start and end dates. Alerts can be displayed through a native WordPress widget or easily included in theme files.

Finally, perhaps the most important observation is that transit sites often need to update in order to reflect service changes. GTFS Update is at the heart of the plugin; it both creates and updates routes and timetables directly from the live feed. It eliminates both the redundancy and increased chance of errors from entering the same data in multiple places.

We invite you to visit the plugin site, download the plugin and download the theme template, and let us know what you think! Keep in mind that both are still in the alpha stage, so there are still rough edges.

Interested in contributing? Both projects are in GitHub and we welcome pull-requests, forks, and feedback.