Today, I decided to try to create a template for single property web sites. I wanted to have a nice template, that featured a photo gallery, and all of the other property information that made sense. Working with some old listings, I set out on the first task, which was having a photo gallery. WordPress 2.5 seemed like the ideal version for this, as photo galleries are now supposed to be a standard feature. As well, the Options theme, by Justin Tadlock also seemed like a good choice, as it too has a pretty slick featured photos “option”, as one of it’s many theme options.
So, I set up a new domain, installed WP 2.5, installed Options, and quickly did some crude test posts. I was able to get the Featured photos option working correctly, but the gallery was giving me trouble. I kept struggling with it, and struggling with it, sure that I was doing something wrong. I searched via Google for any reference that the gallery doesn’t display for some people, and could find nothing. Searching the WordPress forums revealed no help. Finally I decided to read the code. Sometimes being a developer has its advantages, though I resist going that route when at all possible. I finally found the offending bit of code. The query that returns the images for the gallery was failing. Looking at the query, I couldn’t figure out how it would work for anyone, let alone most people, but I digress.
Digging in yet deeper, I found that there was indeed a bug logged against this problem in Trac. It’s fixed as of now, and slated for Version 2.5.1. That’s sweet. Accordingly, I’ve decided to install the version of WordPress at the bleeding edge of development, so that I can download this fix and ensure it does indeed fix my problem, the way it would appear to.
The bleeding edge version of WordPress does indeed fix the gallery problem, although there are still issues with galleries and IE 7 and even galleries and Firefox, dealing with adding photos to the gallery. I’ve developed a workaround, which requires me to use both browsers to do my first gallery. The gallery display problem seems to be a problem that PHP5 and/or MySQL 5.0 reveal, that earlier versions either mask, or simply don’t expose.
Not quite liking the gallery display functionality, I also decided to write my first WordPress plugin. The plugin is very simple. It adds the text “Next Image” & “Previous Image” below the navigation photos. I can understand why it’s not in the code normally, as it creates a language problem, but needing to write a plugin to address it, and being unable to use either a theme or css solution was rather annoying. Clearly there’s some more work needed in the future of galleries for WordPress.
The gallery also required the Options Theme to be modified to some extent. Most notably, Options doesn’t include any theme support for the attachment viewing of a Gallery, but copying the default PHP for that from WordPress got me pretty close. I’m going to continue to keep this blog around as my #1 test blog for evaluating new releases of WordPress, tracking bugs, and evaluating fixes. Now that I have it set up, there’s no cost and it’s easy to do.
If you are curious, its testblog.teambelt.com.