Mar
5
2009
Like any good obsessive-compulsive blogger, I frequently pour over my web site statistics looking for interesting stuff. One thing that caught my eye is that search results coming in from Google tends to link to threaded comment pages for entries.
For example, I’d get hits to /blog/2009/03/05/entry-slug/comment-page-1/, which is an URL that’s pretty hard to actually find on the page — it’s only used for permanent links to entry comments, with an anchor to the comment ID tacked on, like this.
What I’d prefer to see is incoming hits to the actual blog entry URL – /blog/2009/03/05/entry-slug/ in this case. Luckily, there’s a smart and simple solution — canonical URLs. The Google Webmaster blog explains it nicely with examples.
So I simply add a canonical tag referencing the preferred URL in each page. Now, it’s just the preferred URL on my side — this is just a hint to search engines that tells them that this page is a duplicate, and that I’d prefer them to let results point to one particular page of these duplicates. In 99% of the cases it will be respected, though.
The actual code is just a few lines. Add this in header.php of your theme, somewhere in the head:
<?php if (is_singular()) { ?>
<link rel="canonical" href="<?php the_permalink() ?>" />
<?php } ?>
is_singular is a function that returns true if any of is_single(), is_page() or is_attachment return true — in other words, if you’re currently visiting a single entry, a page or an attachment.
With this, each entry sub-page of comments has the main entry URL as their canonical URL. Now to wait a few days and see when the search engines pick up the change.
no comments | tags: blogging, CSS, HTML, PHP, Wordpress
Feb
2
2009
These are links I found interesting for 26/01 through 30/01:
- GlimmerBlocker — pAd blocker for Safari implemented as a non-intrusive proxy./p
- Noscope | Journal | Extra Image Tags Plugin — pThis is a very minimalistic WordPress plugin, which finds all images you insert into your posts, and wrap them in extra 's, so you can style the hell out of them./p
- The $300 Million Button — p”It's hard to imagine a form that could be simpler: two fields, two buttons, and one link. Yet, it turns out this form was preventing customers from purchasing products from a major e-commerce site, to the tune of $300,000,000 a year. What was even worse: the designers of the site had no clue there was even a problem.”/p
- Cops Talk Funny — p”From recruits in academies to senior officers and command staff, you talk funny when you take the stand. Is it in the water at the academies; is there a secret society where you're taught this special language?”/p
- Videogames outsell DVD and Blu-ray in 2008 — pRetail sales of videogames overtook that of DVD and Blu-ray for the first time, as sales of packaged media grew 6 per cent worldwide to hit USD 61 billion in 2008, according to Media Control GfK International./p
no comments | tags: advertising, Blu-Ray, CSS, DVD, economy, English, entertainment, games, information architecture, language, media, movies, OS X, plugins, police, proxies, Safari, software, usability, user testing, web browsers, web design, Wordpress | posted in Asides
Apr
9
2008
Today is CSS Naked Day. The idea is simple: strip all CSS from your site for a day. If your site doesn’t degrade gracefully, shame on you!
It may not be very pretty to look at (except in a 1995 kind of way), but my site is still fully readable. I didn’t make this WordPress theme though, but I use the very same design principles — and this is essentially how blind people read web pages.
no comments | tags: CSS, memes, web design
Aug
5
2005
Why on earth didn’t I think of this myself? It’s so simple to do, yet incredibly elegant. Here’s what:

That’s the list of recent del.icio.us links over at Lisa McMillan’s site. When I first visited I wondered why those two links had marked checkboxes, and when I realized they were links I had visited earlier I instantly started to mentally slap my forehead for not thinking about that myself.
I’m totally stealing that idea for whenever I design my own theme for WordPress. It’s very simple to do: make a list with unvisited links having one background, and visited links another background. It looks much more special and attractive than changing the link text alone.
no comments | tags: CSS, web design
Dec
13
2003
Yup, new layout is live, but only on the front page as of right now. But I’m not quite sure if I’ll use it — there’s something that’s not quite right about it, and I was really fond of the last one. I’ll work some more on it and see if I can take the best parts of the old one and combine with this one.
There are still a few CSS issues to iron out — Internet Explorer, as usual, is unable to center the contents on the page. To be fixed.
If you think the image at the top is huge, it’s because I intend to put some more content there. I’m thinking about writing my own photoblog software, with some random images grabbed from it to be displayed at the top of the page.
no comments | tags: CSS, web design
Feb
5
2003
Yup. Took me all of fifteen minutes to make a quick PHP hack that points you to different style sheets. It’s in the bottom part of the sidebar. Currently only two styles available, but I’ll make more, you can count on that… I’m already getting tired of Warranty Void, the latest one.
I always pick strange names for my style sheets. The next one will be called Nuisance Value.
1 comment | tags: CSS, PHP, web design