Category Archives: Development

information about stuff i’m up to.

Using shortcodes in a template file in WordPress

I’m using Contact Form 7 on a website I’m building. Currently, Contact Form 7 uses shortcodes, meaning you can drop forms into posts. Something like [contact-form 1 “Sign up form”] Read More »

Replacing multiple occurrences of a string in JS

I’m a little disappointed JQuery doesn’t have something uber fancy for this. Something that always catches me out is when trying to replace occurrences of a string, it only replaces Read More »

Geolocation with Google Maps

A while back I wrote a proof of concept for a site which, at its core, allowed people to pick a location on a map. It used the long/lat for Read More »

Controlling layout with Featured Image sizes in WordPress

Recently, I was working with a WordPress theme that includes a “featured image” (added recently to WordPress). Instead of just displaying it on the frontend, I wanted to know how Read More »

Using post items in Smarty from dynamic variable names

I’m building a site at the moment that uses the Smarty templating engine and I came across a snag today. The global “Smarty” variable includes a nice $Smarty.post reference where Read More »

NoFollow links in comments within WordPress

I’ve recently added comments back into my blog. I know that Askimet will do the majority of the work in protecting me from SPAM, but I wanted to make sure Read More »

Only display add a comment if the post is recent in WordPress

I’ve always got quite a lot of comment spam on the blog, and this is mostly for older posts that I assume are already dead and wouldn’t be commented on. Read More »

How to get a Twitter feed into your WordPress theme

Since Twitter changed things, you’re probably better off looking at A WordPress Twitter stream, without the RSS…     WordPress comes with a version of Magpie RSS as part of Read More »

Tags for custom post types

Custom post types can share tags with normal posts. To do this, add the following line into your custom post declaration. register_taxonomy_for_object_type(‘post_tag’, ‘portfolio’); Custom post types can actually also have Read More »

Accessing WordPress features outside of your WordPress template

This problem has come up once before, but I found another way of dealing with the issue. However, this time, it seems that I’m going to need to find a Read More »

How to get the children of a page (by slug)

Every now and then, I need to display a list of all the child pages of a top level page in WordPress. This might be for a sub menu, or Read More »

WordPress data import

I imported 900 odd articles from a website we’re migrating from another system into WordPress. The information was in CSV format, so I built a quick and dirty PHP script Read More »