Web Design and Build

The lifespan of IE6 Last updated:29 October 2010

Read an interesting article this morning about the use of Internet Explorer. Specifically, the article suggests that now that IE8 is launched, users will migrate from IE7, but many who are still using IE6 will remain, to the point that IE6 will become more popular than IE7. Sound mad? Not really, because many corporate web applications were designed for IE6 when it was effectively the only browser available, and they won’t work with IE7. Larger companies tend to be intrinsically risk-averse anyway, upgrading a browser is low priority – my own experience certainly supports the argument.

A couple of sets of web stats highlight the issue. Looking at some stats from a large public sector website, 80% of visitors are using IE, of which 40% use IE6. This website will be frequently accessed by people at work. By contrast, one of the sites I run, which tends towards consumer usage, has only 60% IE users, of which only 15% use IE6

So the bad news is IE6 may live a lot longer than we might like…

Integrating WordPress into your website Last updated:29 October 2010

In the last couple of weeks I have incorporated WordPress blogs into two sites, applying the existing site style to the WordPress pages.  You’re looking at one of these right now…

I didn’t particularly want to replace all my existing pages with WordPress pages, I just wanted to use the WordPress functionality to power the blog element. Pretty common requirement I’d have thought. I found this article a useful starting point.

So, if you have an existing site with its own css file and you follow this tutorial exactly then you will end up with two similar css files, your original one and one just for WordPress files called style.css. So then you have to make changes in two places…I didn’t want this so additionally amended header.php to point at my “main” css file. The downside of this is that you can’t update your css file through the WordPress admin module, but that wasn’t at all an issue for me.

It’s pretty much guaranteed that this will break the display of at least some of the wordpress pages, as chances are you won’t have entries in your css file corresponding to the html markup that WordPress generates. The same things will happen of course, if you replace the contents of style.css with your own css.

For example, my main site uses #header and #footer as id names, just as WordPress does, so no changes required here, but I used #maintext instead of #content for the main page content. So you can either amend the html so the WordPress files use #maintext, or add #content to your css.

In this case, you can identify #content just by viewing the various .php files – but some classes and ids are directly generated “on the fly” and don’t appear.  I found the easiest way to do this was to view the actual pages using Firebug, and make additions to my css file accordingly.

This isn’t quite as painful as it sounds as WordPress is pretty consistent about the markup.

I’d guess it took a couple of hours in total to do, including actually amending the contents of sidebar.php. Worth it as all my styling sits in one file.

New HTML5 elements and IE8 Last updated:29 October 2010

I was reading a discussion on a forum last week about HTML5, and thought I’d have a quick mess around with it to see what happened with various browsers. I created a test page using the new tags provided by HTML5 (<header>, <footer> etc.).

This page doesn’t display correctly in any browser that I tested (FF3, IE6/7/8, Chrome2, Safari 4, Opera 9.63 or even Opera 10 beta2), although FF, Chrome, Safari and Opera all display the <aside> element correctly for some reason.

I then applied display:block to the css for all the new elements and tried again here.

Slightly to my surprise the page looks fine in FF, Opera , Chrome and Safari. Slightly less surprisingly, it fails horribly in IE6 and IE7. The biggest surprise for me was that it looks just as bad in IE8. I suspect, on reflection, that the browsers that worked did so because of their treatment of unrecognised html elements, rather than their support for the new HTML5 elements.

HTML5_IE8HTML5_Opera

Here’s what it looks like in IE8 on the left (pretty much the same as in IE7 and IE6) and here’s how it should look in Opera 9 on the right. I have to say I expected it to be OK in IE8, given that’s the pretty much the newest browser I tested with. So much for HTML5 support in IE8…

Conclusion: being able to use even the simpler features of HTML5 looks a long way off…

Stop WordPress adding <br/> tags Last updated:29 October 2010

Been swearing at WordPress this afternoon…

I’ve been trying to transfer an html form, which I had working perfectly on a static html page, onto a WordPress page. WordPress insisted on adding multiple <br/> tags where I didn’t want them. Mutter.

Eventually, after much searching, I identified a parameter within wp-includes/formatting.php, which allows you to disable this irritating feature. If you open formatting.php and find the function wpautop you’ll see this:

function wpautop($pee, $br = 1)

Change this to:

function wpautop($pee, $br = 0)

Save the file and publish it back to your server and that’s it. Works fine in WP2.8.

Note: WP 2.8.3 overwrites formatting.php so this change needs redoing.

Update 24 October 2010

Fed up with repeatedly doing this I’ve developed a WordPress plugin to address the issue. Give it a try and let me know if it works for you.

Paypal Website Payments Standard in the UK Last updated:29 October 2010

I was messing about with the Paypal “Website Payments Standard” yesterday, looking at a possible small scale trial on a site. Really easy to set up, but then I tried to do two more things, specifically, restrict orders to “home country” customers only, and calculate postage by weight.

After a lot of reading of help files and Googling, I eventually find that both these options are only supported for US customers – the “shipping by weight” despite it being all over the help pages and even giving you the option on screen – which then has no effect.

Thanks Paypal…