Archive for April, 2008

 

Galleries and PHP5 in WordPress 2.5

Apr 21, 2008 by Steve Belt in Blogging

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.

Upgraded my side door to wordpress 2.5

Apr 04, 2008 by Steve Belt in Blogging, General

What better blog to be the guinea pig for WordPress 2.5, then my personal blog that I know almost no one reads. Out of the box, I love the new interaction with plug-ins. In 2.3, we got notification that plug-ins were out-of-date. Now with 2.5, we get a way to download and install plug-ins that are out-of-date, directly from the admin panel. This was awesome!

I’m using Windows Live Writer to compose this message, and then I’ll see if I can save as draft and edit online, just as I was before.

===save draft and finish editing online===

Yep, that works well. There is a problem in the online editor…it seems the editing window is too wide, and it’s covering up the publish button that should be the right of this editor window. I suspect that has to do with my variable width CSS, and possibly one of my editing plug-ins that hasn’t updated to 2.5 yet. Switching to the HTML view fixes it, but it’s annoying none-the-less.

Now I’ll add a picture online, even though I suspect I’ll always do that from Live Writer in the future, just to see if it’s different. Well, that’s not going to work. I can upload a picture, but I can’t seem to get the picture to want to go into the post. This was supposed to be one of the premier features of 2.5, so that’s not a good result, and it’s unacceptable that picture insertion doesn’t work…completely unacceptable.

Another thing that’s always annoyed me, and is no different now, the Preview button doesn’t save before it previews. What’s up with that?

Hmm, my verdict: I love the plug-in change, but the pictures not working is a deal breaker.

UPDATE: In Firefox images load and are managed perfectly…so it’s something with IE. I should have guessed. In Trac for WordPress, defect 6502 is noted with the same symptoms I’m having, so I added a note to the defect that I’m experiencing it too.