I recently gave a lightning talk at the WordPress Developer meetup here in Melbourne which included 10 Workflow Tips for Developers creating custom WordPress themes, here’s a recap!
1. Create a Starter Repository
I have a ‘starter’ Git repo that I clone when creating a new custom WordPress theme locally, it includes:
2. Create a Local Dev plugin
I have a local development plugin (similar to a functionality plugin) that I tweak per project. I’ve published an early version of this plugin up on GitHub however it’s intended to be forked & customised per project. By defining a couple of constants in my local wp-config file I can easily tweak my WordPress install based on the environment (local/staging/production).
3. Switch to VVV
My next tip is to switch your local development (MAMP / XAMP etc) to Varying Vagrant Vagrants (if you haven’t already).
The main reason I switched to VVV was for the VV Site Wizard, it allows you to easily create a WordPress install with just a few commands in terminal (it takes care of downloading WordPress, creating database, users etc).
The VV site Wizard also works great with my starter repo, so I can be setup with a fresh WP install for a client project in under 5 minutes (most of that time is just waiting for my repo to clone down).
VVV has a bunch of other great features, it has WP-cli built in, it has a (relatively) small footprint so it’s ideal for lots of small projects and it can be easily configured to do things like automatically backup all local databases on vagrant halt.
4. Use Migrate DB Pro
Dealing with migrating the WP database between local/staging/production can be a little tricky, error prone and time consuming so my tip is to use Migrate DB pro as it just makes this process really easy. With Migrate DB Pro you can
- Easily push a database up
- Easily pull a database down
- Easily export a datbase
5. Checkout Dash
6. Save time with a task runner
I’m always keen to improve my productivity and automate any repetitive tasks so it’s no surprise I’m a fan of task runners like Grunt and Gulp. I’m happy to use either to compile my sass, concatenate my JS, optimise images, generate sprites and to live reload my browser.
7. Deploy via Git
Typically I just have the wp-content directory stored in git (however this can change depending on needs of a particular project).
8. Automate Git Commands
I have a bunch of handy Git Aliases that help me automate a bunch of repetitive Git commands, check out my post on Handy Git Aliases from earlier this year.
9. Automate your workspace
I’ve also been Automating my workspace to ensure I can quickly switch between projects (and open up multiple terminal windows, start Grunt or Gulp etc). Checkout this post if you want to find out more how I’m automating my development workspace.
10. Use Alfred workflows
I’m a big fan of Alfred, I actually have another post from earlier this year about Improving your website development productivity with Alfred, to quickly recap, it’s awesome because it gives you
- Quick access to Dash Docs & your Gists
- The ability to easily Convert Colours HEX to RGB
- The ability to easily find font awesome icons
If you have any WordPress workflow tips that’d you like to share please get in touch on twitter.