WordPress Page Numbers #2

Update: A new version of this plugin has been uploaded. See below.

A while back, I wrote about a plugin I’d discovered that I really wanted to use but didn’t work. So I rewrote it.

I’ve rewritten it further, and now decided to release my version as it’s own plugin, given that I haven’t heard back from the original author.

It does pretty much what the original plugin did, and uses it’s css, however the code has been totally rewritten and it actually works!

It also my first plugin to make use of … Continue Reading

WordPress Settings API – a quick implementation

Updated: v1.3 released making use of Namespaces.

I’m currently building a plugin that requires some configuration options, and although there are easy ways of saving plugin ‘options’ in WordPress, there is a push towards making use of the Settings API.  As I like to do things correctly, I thought I’d investigate it.

WordPress does make a habit of creating mountains out of molehills sometimes, and the Settings API seems to be a fantastic example of this.  Trying to follow the instructions on the initial page got me hopelessly lost, and it was only when I went through Otto’s WordPress Settings … Continue Reading

WordPress Page Numbers

Update: Please see this post on the release of this as a proper plugin.

I’m starting to get annoyed by the number of WordPress plugins that I find that then don’t work when I try and install them.  They are either created and abandoned, or simply the author hasn’t checked them properly (particularly in a version of WordPress with all the error messages switched on).

This plugin wp-page-numbers was exactly what I was looking for.  But it didn’t work in Version 3.1.  Plus it was really bloaty in terms of code.

So I spent a little time … Continue Reading

WordPress plugin for forwarding/redirecting campaign and legacy URLs

I’ve built my first WordPress Plugin.  It’s for something that I’ve needed for a website I’m working on, and very suprisingly haven’t been able to find the plugin that I’d want.  It’s so blindingly simple that it took less than an hour to code, and relies on six lines of code.

The plugin was built to redirect legacy URLs from websites that have been converted into a WordPress site. It obviously can also be used for other redirecting, eg having a short URL that directs to a page as part of a campaign.

To install:

Correctly format UK telephone numbers

I hope my friend James Cridland doesn’t mind me posting this on here.

He built a PHP function to properly format UK telephone numbers. He admitted it wasn’t particularly well coded, and asked for help with writing it more efficiently. So that’s what I did.

You can find the code here.

Measuring outbound links in Google Analytics

One thing that’s always been quite difficult to do is measure outbound links from your website, in other words how popular links to external sites are. For commercial sites, there is little value in knowing this, but for information sites it can be extremely useful. My former employer, the BBC, is possibly unique among organisations in actually having outbound links as a KPI.

There are various ways of doing this, but the standard way is to have a “dummy” link on your own website that you can record before automatically forwarding the web visitor onto the external site.  This makes it … Continue Reading