Category Archives: Snippet

Shell script to create new site template

Having a dedicated Linux box without any form of control panel on it is becoming the norm for me. To help me out, I created a small shell script to Read More »

String replacement with SQL

Quite often, especially when working with WordPress sites, I need to update content with a new web address. This happens when a site has been on a preview domain whilst Read More »

String replacement in Smarty templates

Usually, all data should be ready for display by the time it hits a smarty template, as it’s a presentation layer. However, from time to time, there is a need Read More »

Excluding directories when tar/gzipping

You can exclude directories when tar/gzipping folders in the following way:

Opening links in a new window with jQuery

With the advent of XHTML Strict 1, you can no longer use target=”_blank” on an A tag in your code. The only solution for this is to use Javascript to Read More »

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

You can’t use shortcodes 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 »

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 »

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 »