Customizing Wordpress: Where to Learn

After studying Wordpress and hacking my site all evening last night, I’ve learned a lot. Most importantly, I’ve learned that:

  • This has all been done before, and …
  • The techniques involved are extremely well-documented.

So much for blazing new trails! But seriously, MattM and the folks at Wordpress have done such a great job of documenting how to customize Wordpress sites that you’d be a fool to wade in without checking a few of their online resources first. I reached a point last night where I realized that I’d get this transition done a lot faster by doing a little homework up front and carefully studying my options.

If you’re looking to customize your Wordpress site, here’s what I think is on the “must read first” list …

The Basics

There’s a great overview of customizing Wordpress, with lots of specific examples and links to reference materials, right here: http://codex.wordpress.org/WordPress_Lessons. Browse through that, and you’ll quickly know where you want to focus your attention more closely.

Template Tags

These are the basic building blocks of customizing Wordpress: PHP expressions that are interpreted and expanded at runtime into useful pieces of content for your site. The master list of template tags is here: http://codex.wordpress.org/Template_Tags. They range from simple tags that insert the date or the title of a post, up through complex objects with interactive functionality, such as the calendar control that now graces the top of the sidebar to the right. To insert that control, I just pasted the following line into sidebar.php:

< ?php get_calendar(2); ?>

With that kind of leverage, a PHP novice like me (or you?) can be pretty productive right away.

Themes

I started from the Connections theme, although based on what I’ve now learned I’m tempted to go back and start from scratch. I probably won’t get around to that for at least a few weeks, though, so for now I’ll keep tweaking what I’ve created from that starting point. If you want to see what’s possible with themes, check out the Official Wordpress themes page. Some very clever CSS coders have put together themes for Wordpress, and some of the best ones remind me of the cool stuff on CssZenGarden.com.

How do the Templates Fit Together?

I think this is the key to understanding how to customize your Wordpress site: understanding how and when the templates are used by the Wordpress engine to render your pages. And there’s a great one-page summary of the concepts at this address: http://codex.wordpress.org/Stepping_Into_Templates. Sit back with a cup of coffee (scotch seems to work, too) and ponder that page, and you should be off and customizing in no time!

So those are my recommendations for getting started. The rest is just details. I’ll get into some of those details going forward, but for now I need to get back to work. Meanwhile, if anybody has suggestions on things you’d like to see, or aspects of the existing user interface that seem clumsy or could be improved, let me know.

Scrolling DIV Test


Test of a Scrolling DIV

Here's a little test of a scrolling DIV.
Here's a little test of a scrolling DIV.
Here's a little test of a scrolling DIV.
Here's a little test of a scrolling DIV.
Here's a little test of a scrolling DIV.
Here's a little test of a scrolling DIV.
Here's a little test of a scrolling DIV.
Here's a little test of a scrolling DIV.
Here's a little test of a scrolling DIV.

This post is just to test whether Wordpress will let me put the code for scrolling DIVs in the HTML that I write for posts. Should be pretty obvious whether it’s working.

Simplify, Simplify, Simplify

I thought I’d be adding some clever new things to the blog, and I am. But I didn’t realize how much I’d be removing.

All that stuff about categories of posts and so on just doesn’t apply to my blog, or to most blogs. Do you ever constrain the view of a blog by category? Me neither — I just look at the post I linked into, perhaps read it, perhaps not, perhaps scroll through some other posts, perhaps type something in the blog’s Search box, then move on.

If that’s truly typical blog behavior, then I think these changes are headed in the right direction. After I get a few more things done, I’ll stop and write up some of what I’ve learned.

Where’s My Blog?

The first hurdle in customizing a Wordpress theme is finding it. Every theme you’ve downloaded — regardless of whether you’ve ever installed it — has a folder for its PHP files, and an img sub-folder for the image files.

I’m using a theme designed by Patricia Müller (PatriciaMuller.com, VanillaMist.com), which she calls “Connections.” That was my starting point, because I liked the general look and feel of the theme, but I’ve now modified it in many ways.

So when I connect via FTP to my site, the current presentation (”look and feel”) information is stored in this folder:

/users/home/dmahugh/web/public/wp-content/themes/connections

Once you get there, some of the changes are pretty intuitive even if you don’t know PHP, HTML, or CSS very well. There’s an index.php that defines the home page layout, there are some files with logical names like sidebar.php, footer.php, and header.php. One of the first things I did was to change the image at the top of the home page, which meant simply replacing the file top.jpg in the img folder.

Next I’ll go through how to make some more comprehensive types of changes to a Wordpress blog’s look and feel.

Making Sausage

Did you read Upton Sinclair’s “The Jungle”? I realize a lot of people had to read it in high school, and thereby developed some kind of deep-rooted hatred of the book. But I had the foresight (or something) to not read any of the books I was supposed to read in high school, and that made them all potential favorites later in life.

I read “The Jungle” in the early 80s after moving to Chicago, and loved it. The stories of the meat-packing industry on the South Side at the beginning of the 20th century were thrilling to me, and Jurgis’s “I will work harder” response to everything struck me as hilarious in ways that I still struggle to convey in my own words. I will work harder!

“The Jungle” is also sort of inspirational to me because it was an early example of the power of the printed word, which became more of a theme as the 20th century progressed. Sinclair single-handedly changed the meat-packing industry, making it safer and cleaner for everyone involved, by simply making the truth be known. Blogs are doing that in many places these days (I’m currently reading “We Are Iran: The Persian Blogs” — great book, more on that later), but the concept of turning a mirror on society and making it heal itself isn’t anything new.

Anyway, there’s that old saying about never watching sausage or laws being made because the process is too messy for most people to find pleasant. And hacking a Wordpress site into what you want it to look like may be a similar sort of endeavor. Nonetheless, in anticipation of New Year’s Day and a bold start to 2006, I have decided to put my regular readers — all 5 of you, including Mom — through the disgusting and disturbing process of watching my blog slowly transform into Doug’s World 2006. It may not be pretty for a while, but by January 2 I’ll be done and things will settle down into a new routine around here.

Between now and then, I’ll post a few things to help my fellow Wordpress users learn from my experience. If you’re into HTML, CSS, XML, RSS, PHP, Wordpress, or acronyms in general, the next few posts are for you.

Kids Love Attention

Man, my comments about how much Microsoft’s coffee sucks sure hit a chord with some people. After Scoble linked to me, a bunch of other people have now done the same. I even made the Seattle PI’s web log, in their Holiday Grab Bag of blog links.

The PI seems has always been nice to me, though. When I played a Defender marathon in Seattle on Super Bowl Sunday ‘82, Erik Lacitis of the Seattle Times said he was going to write a column about me. He interviewed me before the event, and was struck by my extreme confidence that I’d pull it off (playing 24 hours on a quarter). But the PI sent a news crew to shoot some pictures and talk to me when I finished at 8:00AM, and they ran the story right away while Erik was still pondering what to say about me. Then he decided he couldn’t write about me after all, because the PI had “scooped” him. I love the PI.

Will I get this much attention when I start covering some more technical topics after January 1? Stay tuned …

Christmas Day



We hope everyone’s having as much fun as we are on Christmas!

Doug didn’t get up early enough to go on photo safari before the weather got bad, but he’s enjoying the 18-year Macallan from Megan while she watches her new portable DVD player. We let the cats go out for a while — the boys had fun exploring, but Murg went straight into the crawl space under the house and won’t come out. She’s still there, afraid to come any further out than in the picture above.

Have fun and drive carefully today.

Long Way Home


After a good workout at Pro Club (Megan and I were among the people kicked out at 3:00 when they closed today), I decided to drive the long way home for a change. That is, go south along the shore of Lake Washington instead of down through the Rainier Valley.

I had my camera, and I took a bunch of pictures with the 70-300mm lens — I haven’t used that one for a while, so it seemed fresh and interesting. There were very few people along the lakefront, so I shot things instead of people. Tomorrow I’m hoping to get some good people shots on Christmas Day.

It’s sure nice to live in an area where shots like these are there for the taking on my drive home, without going more than a few blocks out of the way. Even on a cloudy day when there’s no direct sunlight and it’s starting to get dark.

Merry Christmas, everyone!

I-90 over Lake Washington


Traffic was light today crossing the westbound I-90 floating bridge. It seems everyone is at the stores doing last-minute shopping or something.

Microsoft Dev Videos

There was a time, not long ago, when you had to travel to Redmond — or attend an expensive conference somewhere — in order to hear the architects of Windows and other Microsoft technologies talk about the inner workings of their creations. But now, thanks to on-demand video over the internet, you can hear all about the code that goes into Microsoft products direct from its creators, without ever leaving your desk or your home office.

Here are two great examples, things to watch on that hot Xbox media center you’re probably getting for Christmas.

The first is a slightly wacky look at what you can do with the WindowsFX API, featuring “The Godfather of COM” himself, Don Box. He makes his grand piano playable from anywhere in the world via an Xbox wireless controller — perhaps not one of the scenarios WinFX was intended to enable, but a fun one nonetheless if you’re the least bit interested in music, technology, or Windows APIs. (And who isn’t, this time of year?)

The second is a brand-new production from Channel 9, featuring Rob Short and some of the other chief architects of Windows Vista. I haven’t actually watched this one yet, but I’ll be checking it out over the weekend from home, and I’m sure I won’t be the only one.

Check these out, and if you want more of this type of content be sure to keep an eye on Channel 9. (The name comes from that channel on the sound system in airplanes where you can listen to the pilot talk to the tower. The goal is to give software developers that sense of reassurance that comes from knowing what’s really going on behind the scenes, and based on the response from the developer community it seems to be working quite well.)