UPDATE – January 2014

I’m no longer actively maintaining this plugin. If you’re having trouble with it, I’m sorry, but I’m not able to devote the requisite time to it. My understanding is that other people are adding new versions.

Showtime is a WordPress plugin for managing a repeating schedule, like one you would find on a radio station’s website. It’s also capable of displaying the current show (if one’s on) as well as the next scheduled show.

Feature list

  • Easily enter and maintain a weekly schedule of shows.
  • Display your schedule on your site using template tags or shortcodes.
  • Display the current and upcoming shows in a JavaScript widget anywhere on your site.
  • Each show can have a URL and image attached to it.

Showtime’s main function is to display a rotating schedule that isn’t tied to any specific day. It isn’t really appropriate for use-cases where a scheduled event needs to correspond to a specific date.


Showtime is currently in its third version (3.0). It’s a ground-up rewrite of the buggy, hacky, unsecure (insecure?) 2.0, which was not a great improvement on the 1.0. The long and short of it is that I wrote the first version when I was a much more immature programmer, and I decided to throw out the crappy old code and replace it with something much cleaner and easy to maintain.

There were easy bug fixes, like using wp-enqueue to load jQuery (I’m embarrassed to admit that, yes, I had hardcoded jQuery into the 2.0) or understanding the difference between echo inside a PHP function and return, which caused all page content to appear below the shortcode output, no matter where on the page the shortcode was.

Example of better coding: Here’s the old method for displaying the current show:

  1. Get all the shows from the database. Sort them by time and return HTML output in the form of an unordered list with start and end unix timestamps saved in custom attributes.
  2. Add this \<ul> to the DOM somewhere. Hide it.
  3. Using jQuery, check the timestamps attributes of each list item until it finds one that starts before the current time and ends after it.
  4. Get the next list item as well. (If there is no next item, grab the first one)
  5. Copy the HTML of these \<li>s into the appropriate DIV in the DOM.
  6. Every 30 seconds, repeat.

Here’s how it works now:

  1. Using a single MySQL call, get the current and next shows. Return a JSON object.
  2. Parse the JSON object and display the information appropriately.
  3. Since the process is much, much simpler, it can be repeated every 10 seconds without needing to worry about resource consumption.

Another example of streamlining (and thereby improving maintainability) was the shortcode that displays the static list of the entire schedule. Previously, I was using time ranges to define the start day, which required grabbing all of the scheduled shows and then checking them against a series of timestamps (which, given the nature of the way the schedule is rotated, were not always lining up with reality). For 3.0, I added a dayOfTheWeek column to the database table and it retrieves the list from a $daysOfTheWeek array.

Such a simple solution, for whatever reason, escaped me when I first wrote the plugin.

You can download Showtime from the WordPress Plugin Repository. Feel free to leave suggestions/complaints in the support forum, or just get in touch.