The Move to WordPress

23 Jun, 2004 | Site UpdateTdp

The previous version of this site was run by a custom CMS/blog system I built from scratch. I built my own because I wanted complete control and because it allowed me to mess about with some PHP functions I'd never used before and expand my knowledge of how to do things that may come in useful later. Unfortunately, the bug list (not to mention the desirable features list) was mounting and I just didn't have time to spend writing and debugging the necessary code to get round them all. Push came to shove when, for some unknown reason, one of my posts wouldn't show up as anything more than the first letter (I have since resolved that issue).

So, having decided to grab hold of some blog software, why did I choose WordPress? Well, the recent changes in Moveable Type's licensing didn't affect me as I still qualified for the free version. On the other hand, as pointed out by a few, MT was never 'free' it was just an illusion, and there's nothing stopping Six Apart from removing the free version altogether today, tomorrow or next month. I didn't like that kind of uncertainty. On the other hand, it's coded in perl, which is a language I'm unfamiliar with. Knowing that I would probably have to make amendments to get it to work how I wanted it to meant I needed the ability to tinker. Then there's the fact that MT uses static files, which means having to rebuild your site every time you post, something that takes longer the more you have on your site. WordPress also seemed to be getting a lot of attention during the MT backlash, and some of the big names were moving to it, so I decided to take a closer look. The feature list, especially for v1.2, was more than what I was after, and being coded in PHP, plus the integration with a MySQL database for storage, meant that I already had the coding skills and comfort level to 'dabble' when the need arose. Of course, because it's open source it means that there is never going to be a problem should development cease or the cast change.

So, I set about looking at how to implement my original system using WP. Because I essentially ran two blogs, one for my day-to-day comments and one for my articles, it meant that I was going to have to be a little more creative, especially when it came to templates. An evening spent dabbling proved that I could get along with WP and that it was fairly easy to play with and so the move began, on my own development machine to start with. Essentially I use WP as an admin back-end and a series of functions, calling whichever I need at the appropriate time in my template. It's actually much closer to a CMS than a blogging system on this site as I use it to create pseudo-static pages for my 'About' and 'Contact' pages (though if anyone can tell me how to get the suckers from appearing in the archives, please let me know).

Using WordPress has actually opened my eyes to a few of the problems I was having in my own system. For example, my previous home page automatically lopped off the end of a post if it exceeded 800 characters. The problem was, this could be anywhere, so I had to come up with code to find the nearest full-stop, and check that if there was an unclosed

tag, that it was closed or the page would be all over the place. I had implemented this, but it wasn't neat, and I still had plenty of other problems, there are all the other tags that could, feasibly, be open. I noticed for example, that some of my posts were cut in the middle of anchor tags and italics, meaning that links either didn't work, or turned the word count into a link, or in the case of italics, the entire rest of the page italic. WordPress uses a special tag that you insert manually to indicate where to lop off a post, not automatic, but significantly easier and more manageable as the author can decide where is appropriate to cut. Equally, my system allowed me to add new categories for my posts on-the-fly if necessary via a box at the bottom of the category selection area, though it was limited in my implementation, this might be something that could be added to WP.

In the end it took a great deal of hacking and modifying, but it pretty much works the way I want it to now. Everything runs through the index.php file, which is a complete mess of tangled code and if statements, but it works (I long ago realised that I don't produce pretty code, my code may look horrible, but it works). As plug-ins appear and get refined, or other needs arise, I may add extra functionality, we shall see.

Overall I'm finding WP a pleasure to use, and very easy to get on with. I'm making use of some of the functionality I didn't think I'd need, plus installing plug-ins like they're going out of fashion. Now at least worries about the technical stuff can take a back seat and I can focus what little time I have on the writing, which is what the site is all about, for me at least.

Oh, and I made a few changes to the look of the site while I was at it.