Fred Koschara - My official personal Web page

The Internet Home of

Fred Koschara

My own blog theme – finally!

Jul. 18, 2014, under progress reports, Web dev

Since I first installed WordPress and set up my blog on this site, it’s been using the pixeled theme, which was OK – but it made my blog look like something attached to my site with bubble gum, duct tape and baling wire – it didn’t fit in. Among other things, while it was easy to pick a menu item from my home page to get to my blog, there wasn’t a link in the reverse direction: Once you were in my blog, there was no going back to the rest of my site unless you used your browser’s button or re-entered the Web address. I’ve never really been happy with it, but I also had the impression it would take a significant investment of time and effort to build my own WordPress theme.

I read through a couple of tutorials Monday night (July 14) and got a rather different perspective: Between having delved into the workings of WordPress when I was contracting at MIT Sloan School last year, and the presentation in the tutorials, I thought it might not be too much work, after all, to create my own theme, to make my blog fit into my site smoothly.

I started working on creating my theme about 9:30 Monday evening. By 2AM I’d made a couple of slight changes, but most of the time had gone into cleaning up the ghastly code I was trying to adapt. Who was the VisualBasic idiot that came up with the if: endif type of conditionals for PHP? Brackets are much easier to follow – and to make sure you’ve got your blocks properly closed! I’ve got WordPress 3.8.1 running here, so there’s no need for pre-2.7 code – gack!

I had to take a break from 2AM until about 3:15 to post another picture on Photo By Fred, and to validate Tuesday’s entries for the Space History newsletter. After installing my barely changed theme on my blog, it took practically two hours just to get back to where it would display again: There’s something wrong with the PHP installation at eApps and syntax errors in nested function calls aren’t being recorded in the error_log, so I had to trace through WordPress to find out where there was an extraneous close-bracket in one of the theme modules where I’d been optimizing the code, and a missing close bracket in another module where I’d missed a VisualBasic PHP block being closed.

Once I got the theme to display, I started modifying it, an iterative process that kept going and going and …. Eventually it converged on a solution, and before 11:30 Tuesday morning I’d gotten to where I was happy with the way it looks: My blog now looks like an integral part of the site, and I’m pretty comfortable with the color scheme and layout (at least for the moment).

There are still HTML validation errors because the AddThis plugin uses the same ID for every element on the page and doesn’t escape ampersands the way it’s supposed to, but those problems are common enough that most browsers handle them without taking particular notice. I should probably submit bug reports to the plugin’s developers. I’ll get to it one of these days when I’ve got nothing to do and a staff to do it with…

In the mean time, my blog has a new look and feel, and I’m happy with the way it works – so the roughly 12.75 hours of work I put into it paid off nicely.

 Digg  Facebook  StumbleUpon  Technorati  Deli.cio.us 


Leave a Reply

Site Features