Improve WordPress theme workflow

  • August 29th, 2006

Anyone who deals with multiple WordPress driven sites in concurrent development can attest to the tedious task of creating the basic folder and file structure requirements. Note that the following tip is not limited to the development of WordPress. The tip can very well be applied to any active developer workflow which requires some type of structured templating system.

base wordpress directory

The basic WordPress directory structure, in its simplest form, resembles the following:

/wp-content/themes/theme folder/
/wp-content/themes/theme folder/images/
/wp-content/themes/theme folder/js/
/wp-content/themes/theme folder/header.php
/wp-content/themes/theme folder/home.php
/wp-content/themes/theme folder/index.php
/wp-content/themes/theme folder/single.php
/wp-content/themes/theme folder/footer.php
... additional templates

Repeatedly recreating the above file structure is not so much as time consuming as it is tedious. Being a creature of habit, my local development folder contains a single generic base directory from which all development begins. Within this base directory, I’ve created the essential templates which I would normally use during development. Each of these templates is stripped to the core allowing complete flexibility on a per project basis while saving time retyping redundant code. Creating WordPress driven sites from this point on are as simple as duplicating and renaming the generic base folder and making the appropriate customizations.