10/14/2016 - 6:15 PM



Wordpress theme development workflow

System requirement

Dependency Instalation

Check system requirement

git --version && node -v && bower -v && gulp -v && wp --version && php -v && which mysql && uname -a

Adding vertual host

Add below code in .conf file located in /etc/apache2/sites-available/

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /home/dev/dev/wpautomate

Then restart apache2 sudo /etc/init.d/apache2 restart

Then edit host file located at /etc/hosts add below code

Creating new project

Create the new directory in your apache document root or your choices. cd {your directory} Enter your project directory yo wp-automate to generate WordPress project structure Select appropriate options from generator prompt

Understanding automation

  • Download latest wordpress from
  • Install npm for automation
  • Install bower dependency for front end
  • Install wpautomate themes from github/bitbucket
  • Rename theme with your project dir name
  • Create database
  • Install wordpress
  • Remove unused theme and plugins
  • Install unit testing data

Workflow with git

  • Create git repo in wordpress project root
  • Create sub module for uploads dir
  • Understanding .gitignore

Create a git reposotiry. Run git init in project root. Create a git repository in wp-content/uploads/ . cd wp-content/uploads/ then run git init. Back to root directory cd ../../. Add submoule git submodule git submodule add git@mygithost:projectname-uploads wp-content/uploads.


Upload in bitbucket

  • git remote add [REPO URL]
  • git push origin master

Upload in dev server

Method 1:

  • Create git repo in dev server
  • git remote add deploy [dev server]
  • git push deploy master

Method 2:

  • clone git repo in dev server
  • git remote add origin [bitbucket server]
  • git pull origin master

Shell script

  • Modifying setup script
  • Modifying package script

Video Tutorial