Posts tagged as "javascript"

Customising WordPress Without Modifying Core, Theme Or Plugin Files

A standard WordPress install is incredibly powerful and flexible. For a lot of people, WordPress out of the box plus one of the stock WordPress themes is enough. But the possibilities for customization are endless; you can add plugins and other themes. Sometimes these do just what you want. Sometimes you need to ... tweak WordPress.

A very high proportion of the customization advice you'll find on the web starts with these lines ... add the following to the end of your theme's functions.php or even worse, advises that you modify the source code of your theme or your plugins. This is bad for many reasons:

  • Editing your theme's functions.php makes theme specific customizations; change your theme and your customizations will no longer get loaded.
  • When your theme and plugins get updated you'll find all your careful hand crafted customizations get overwritten and lost.
  • A lot of theme and plugin authors won't offer support for changes you might have made to the source code.
  • Your customizations might work; but you might also inadvertently make some other changes which will stop things working.

WordPress doesn't yet support a way for site specific customizations to be made and loaded without touching theme, plugin or core files; that's why I wrote WP Customizer and that's what this plugin is for. When WordPress does support such a way, this plugin will thankfully be obsolete.

The Great British Map; Or Great Britain vs. The United Kingdom vs. The British Isles

Last night I made another map. It tries to answer some of more perplexing and confusing facets of the geography surrounding the world's 9th largest island. I mean of course Great Britain. No, wait. I mean the United Kingdom. No, wait. I mean Britain. Or do I mean England? See, it's confusing.

  • So if the ISO 3166-2 code is GBR, how come the country is called the United Kingdom?
  • But if England is a country and the United Kingdom is a country, how come England is part of the United Kingdom?
  • What about Scotland, Wales and Northern Ireland?

This isn't the first time I've covered this topic. The first time was for a post on the now defunct Yahoo! Geo Technologies blog entitled UK Addressing, The Non Golden Rules Of Geo Or Help! My Country Doesn't Exist. The ygeoblog.com domain is now long gone and redirects to the Yahoo! corporate blog but I was able to reproduce this post here and it's also captured in the Internet Archive's WayBackMachine. The second time was when I made a variation of The Great British Venn Diagram. But this is the first time (though probably not the last) that I've used a map, which is odd as this is something that's tailor-made for a map.

You Were Here; Mapping The Places I've Been To According To Foursquare

Over the weekend I made another map. While I don't think for one moment this one will be as wildly popular as my last map was, this one is just as satisfying and a whole lot more personal.

At 8.01 PM on the 11th. of October 2009 I checked into Sushi Tomi in Mountain View, California. This was my very first Foursquare check-in. Since then I've checked-in on this particular location based service a further 12,394 times. Each check-in has been at a place I've visited. As this is a location based service, each check-in comes with a longitude and latitude.

This sounded to me like an ideal candidate for a map. But how to go about making one?

Two WordPress Plugins And The (Missing) Nokia Map

It's a glaringly obvious oversight but a few month's back I realised that given what I do for a living, there's something missing from my blog and that something is a map.

There's a whole slew of "where am I" style WordPress plugins out there, but after some careful research I decided that none of them did precisely what I wanted, which was to show the last check-in I made on Foursquare, on a map, in the sidebar of my blog.

Those that did come close still didn't do the key thing I wanted and that was to use the map I work on as part of my day job. Now don't get me wrong, I've got nothing against the maps that I could have used; Google, Bing, Mapquest and OpenStreetMap produce very fine maps and they all have the JavaScript API I'd need to display my last checkin. But none of them used my map and that means a Nokia Map.

Farewell Yahoo! Maps API, Hello Nokia Maps API

Yahoo's JavaScript and AJAX API was the first mapping API I ever used and it now seems hard to remember when Yahoo's API offerings were the dominant player, always iterating and innovating. The Yahoo! API set formed and continued to underpin the majority of my online presence. When I wrote about leaving Yahoo! and joining Nokia in May of 2010 I said ...

So whilst I’m going to Nokia, I’ll continue to use my core set of Yahoo! products, tools and APIs … YQL, Placemaker, GeoPlanet, WOEIDs, YUI, Flickr and Delicious. Not because I used to work for Yahoo! but because they’re superb products.

... and I meant every word of it. The Yahoo! APIs were stable, powerful and let create web experiences quickly and easily. But now a year later a lot has changed. I still use Flickr on a pretty much daily basis, but Delicious is no longer a Yahoo! property and I transitioned my other web presence from using YQL for RSS feed aggregation to use SimplePie as YQL was frequently down or just not working. The original core set of Yahoo! APIs I use in anger is now just down to Flickr and YUI.

WP Biographia Is But A Quarter Of The Way To WP Mappa

In a way, this was all Matt Whatsit's fault; he writes very profane and very funny blog posts and reading his recent The Five Stages Of P****d Wife (which you should read if you haven't already, err, read it) made me laugh, hell, it made me ROFL and LMAO at the same time but it also made me think, though not necessarily about wives or drunkenness ...

Now background reading and general swotting up on a topic is all very well but to really learn how to do something you just have to roll your sleeves up and do it yourself. Though it's probably stretching a comparison too far, you don't learn to drive a car through reading the highway code; you actually get behind the wheel (preferably under supervision) and ... drive. You don't learn about what food tastes good from a recipe book; you ... taste the stuff yourself.

And so it is with writing code and using new and unfamiliar APIs. It was definitely the case with my recent (reacquaintance of, and) foray into JavaScript and the addition of support for Nokia's Ovi Maps API to the Mapstraction project, with the added benefit of having to teach myself how to move from my (by now very dated) knowledge of version and revision control under CVS to git.

Mapstraction, Maps and Me

It's been a while since my last blog post; my day job at Nokia has been taking up almost all of my time and what little time has been left has been spent with my family. But in between day job and family time there's evenings spent in a hotel room and hours spent on a plane, mainly between London's Heathrow and Berlin's Tegel airports. It's in these periods of time that a combination of my MacBook Pro, running a combo of Apache/MySQL/PHP with MAMP and TextMate has allowed me to rediscover the pleasure of what I used to do for my day job before Yahoo! and before Nokia ... and that's to write code.