code

Reusability thanks to modular coding

My erstwhile mentor in Brienz taught me throughout our years working together that if a website functionality is worth creating, it’s worth creating so that it can be used in more than one project. Programme once, install many times. This is a credo I’ve maintained since I started programming for content management systems and one I try to pass on when working with other programmers.

Percentage-based CSS column layouts

Laying out a page using percentage-based columns seems to be pretty easy. However, in responsive layouts, you’ll quickly run into problems if you don’t take legibility into account. The most obvious case is when the columns are predominantly text-based, where a suitable gutter between the columns is essential for the sake of legibility. (If you… (Read More)

Include timestamp as readable date using SQL (no PHP)

Code snippet for SQL use, to include a formatted version of a timestamp field in database query results.

WordPress function: getting attachment and thumbnail captions for a post

It’s rare that I post anything heavily internet-related or even extremely code-geeky, so please skip this entry if it’s of no interest! I was asked today if I knew how to get the captions of Post attachments in WordPress and so I knocked up the following two functions; one which returns an array of all… (Read More)

getURL and target “_self” not working?

If you’re a Flash or web developer, then you may come across a security-invoked problem whereby links inside your Flash movie don’t react, when you try and open a link within the current browser window. Crazy, I know, but bear with me. I have no idea why this should be so – I’m sure someone… (Read More)