WordPress is great, but the documentation leaves a little to be desired…

Alas, the woes of using open source software rear their heads. WordPress abounds with undocumented, or at least very poorly documented, features.

My dilemma: the default function for displaying a list of page links (used on this site to populate the Points of Interest panel in the sidebar) sorts links alphabetically, and there isn’t any obvious way to make it sort by the database’s menu_order field, which logically, to me at least, should be the default especially given that this is how they’re sorted in the admin tool.

Finding little help in the documentation or by my usual means (Google), I decided it couldn’t be done without modification. In my previous installation of WordPress I actually modified the core code itself to change the sort order, but when I upgraded to version 2.1.1 today, it overwrote that change. This time I decided to try the plug-in approach, so my changes would actually stick through version changes, and so I could get familiar with the powerful but arcane plug-in system WordPress uses for extensibility.

After poking around futilely trying to get my plug-in to work (to the point where it was sorting all of my blog posts the way I wanted the pages to be, but not the page list), I stumbled upon a relevant post in the WordPress forums, where a snide jab at “theme designers” (which seemed to be such a broad swipe that it included me) happened to mention an input parameter in the function that calls the page list!

Silly me… the system has built right in a very simple way to sort the list by whatever field you want, and all you have to do is pass in the right parameters in your theme files. The change couldn’t have been simpler… but learning that it was possible certainly could have!

A fix for a fix in WordPress 2.1

One thing that surprised me when I started using WordPress again is that its search function only searches on blog posts, not on static pages. I suppose if most WordPress sites are 99.9% blog posts, then it probably makes sense, but I have enough static pages on my site that I’d like to make searchable to warrant changing this.

Fortunately, someone has. Unfortunately this “Search Pages” plug-in is out of date and no longer works with current versions of WordPress. I dug in a bit and figured out why: the plug-in alters the SQL query that performs the search, but the substring it replaces in the query no longer exists! So I hunted down the place where the query occurs in the WordPress core, adjusted the plug-in as needed, and it works!

Here, then, is my hack of the Search Pages plug-in, modified to work with WordPress 2.1. (I’m not sure which other versions of WordPress it will or will not work with.)

[ search_pages.php.tar.gz ] [ search_pages.php.zip ]

Welcome to the new room34.com!

The new WordPress 2.1-based version of room34.com is here! I’ve been tinkering with this for about a month now so I’m very excited to finally have it online. And I think WordPress has really taken a major leap forward with version 2. (My loyal reader may recall that I had previously moved to an earlier version of WordPress, only to abandon it a short time later. Frankly, looking back I’m just amazed that I actually used it for 8 months; it seems like it was much less than that, but maybe that’s just because I’m thinking about how I only had Drupal running for about three days.)

There are still a few things left to do: some pages have missing content or broken links; I’m still working on a top navigation bar with dropdown menus (for now the navigation is buried below the fold in the right sidebar… look for Points of Interest and the various links that follow); and there are a plethora of WordPress plug-ins I’m eager to implement.

I’m also moving the photo albums of the kids over into Gallery 2. There’s a lot of work left to do on that, so I apologize to family and friends who are looking for photos. They’ll be back online soon, I promise! (I mean, “I hope!”)

And finally… in the time that I’ve been working on this, I’ve written a few other new blog entries (six, to be precise), which I never bothered to post on the old site. But they’re here, below, so read on!

So long, WordPress!

Well, that’s it. As of last night, the last traces of WordPress on my site are gone.

There’s nothing really wrong with WordPress; in fact, for what it does it’s pretty elegant and flexible. But since, let’s be honest, I’m a geek, and I’m more about building my site than actually creating any meaningful content for it, running it on someone else’s engine is unsatisfying, and almost feels like cheating.

Besides, WordPress (and probably any other third-party tool) will never do everything I want it to, or at least it won’t do it precisely in the way I want it to. And it’s more fun for me to write my own code than to tweak someone else’s. So here we go.

Progress…

I realized what a daunting task it was going to be to use the built-in WordPress functionality to manually copy over all of the articles from my old site database, so I dug under the hood and used the power of SQL to just more-or-less dump everything from one database into the other. So now all (well, most) of the stuff is moved over, and I can begin to disassemble the old site (currently lingering in the link set as “Room 34 Cold Storage”).

If you care to look back at the old stuff (and why wouldn’t you?), you may notice some oddities… that’s mainly due to inconsistencies between my idiosyncratic HTML and the fancy formatting/clean-up WordPress does. I’ll gradually fix that stuff… maybe. (Right after I get around to organizing the basement.)

I’m also tinkering more with the themes. I’ve downloaded several interesting themes that I plan to try out for a while, to get a feel for both their visual appeal as well as the ways they handle certain technical features of WordPress. Once I find one I like, I’ll use it as a basis to build my own, one that incorporates my photography as well. (Will the excitement never end?!)

Oh, I almost forgot to mention… some of the old stuff didn’t have dates, so I hastily and more-than-somewhat arbitrarily assigned them all to January 1, 2004.