WordPress: Adding a sidebar to your theme

In another post I discussed the idea of placing a sidebar into your theme and using it to manage the navigation menu of your site. I came to the conclusion – proposed by other people from the WordPress community as well – that you can use a sidebar for basically anything but not just a sidebar.

Although you can find this information in the Codex too, I would like to show you how easy it is to add a sidebar somewhere into your theme. You’ll see that it’s just about adding some function calls here and there – that’s it and you’ve got a new sidebar that can hold arbitrary widgets.

Continue reading →

Building your own Fetch as Googlebot

Just recently Google announced a great feature as part of the Webmaster Tools: you can fetch your site with the Googlebot. At first I thought they would reveal what content gets extracted from the site and how they might proceed from there but they just seem to crawl your site, showing you the HTTP header fields and the site’s content.

In this post I’d like to present some Java code using the latest and greatest version of HttpClient that allows you to crawl any site, have a look at the HTTP header fields, the site’s content and measure how long it took to download the site. It’s almost the same what Google’s feature does.

The Eclipse project with the code for this post can be downloaded as tar.gz or zip. You can browse the code online here.

Continue reading →

The 27″ iMac – a perfect Christmas gift

Since I switched to Apple using an early version of the MacBook Pro at the end of 2006, I’ve really enjoyed the features of this fine notebook and working with MacOS in general. After working with Linux almost ten years everything got so much easier without compromising on flexibility.

Now, three years later, I decided to get a new Mac: it should be fast and have a big screen. The 27″ iMac with an i7 processor seemed to be the perfect match. This post is about my first week of using this great computer.

Continue reading →

WordPress: is_child function

Every once in a while I would like to test whether the current page is a descendant of another page. This is particularly useful if you want to display certain content on a subset of your pages only. Although the Codex suggests a similar is_tree function I would like to present an extended version here.

I’ve packaged the functionality inside a WordPress plugin called is_child that you can download here. Unzip it, upload it to wp-content/plugins and activate the plugin.

Continue reading →