A WordPress Boilerplate to get going quickly.
@TODO Use Composer instead of git submodules? @TODO bash scripts or fab file for activating plugins @TOOO update wp-config from live site inlcluding ENV stuff @TODO update htaccess to protect git folders
- WordPress itself is a submodule
- wp-config.php, plugin folders and theme files are in the repository root. wp-config.php has been updated to point to these.
- see http://davidwinter.me/articles/2012/04/09/install-and-manage-wordpress-with-git/ for more info on the WordPress set up
$ mkdir wp-site
(or whatever you like)$ cd wp-site
$ git clone {this repo url} .
(note the.
on the end of that command to clone into the current folder. Or fork and clone your own)$ git remote rm origin
# Here we disassociate our new project from the boilerplate project.$ git submodule init
$ git submodule update
. Note that$ git submodule foreach git pull origin master
will likely bork Wordpress
$ mkdir app/themes/your-theme-name
$ git clone https://github.com/roots/roots.git app/themes/your-theme-name
- If you don't already have it installed, install grunt.
- Navigate to /wp-content/themes/your-theme-name and run
$ npm install
- Once it's all installed run
$ grunt watch
and edit away. Any time you change a .less, .js or .php file, grunt will take care of compiling it for you and making it available to the browser. With large less files it can take a sec.
More on Grunt, Roots and Less 9: http://roots.io/using-grunt-for-wordpress-theme-development/
- Import the database from /data into your local MySql database if available
$ cd wordpress
and$ wp db import ../data/data-file.sql
(using wp cli) $ cp local-config-sample.php local-config.php
- Edit
local-config.php
to include your database connection details - Install WordPress via http://yourlocalsiteurl/wordpress/wp-install.php
NOTE: You may want to go into your-theme/lib/activation and comment out
wp_redirect()
first if you'll be setting these options manually in your theme or via WP-CONFIG. - Put this into functions.php after you install it to use
/media/my-photo.jpg
instead of/media/2015/10/my-photo.jpg
. Can safely be removed afterward.update_option('uploads_use_yearmonth_folders', 0);
$ cd /path/to/wordpress
$ git fetch -t
to get the most recent tags. Each release version of Wordpress is tagged.$ git tag
to see the list$ git checkout 3.9.1
or whatever the most recent tag is$ cd ..
Need to get out of the Wordpress directory for the next steps or you will melt poor little git's brain.$ git add wordpress
to stage the update$ git commit -m "Update Wordpress to 3.8.1"
Use WP CLI. Navigate to the /wordpress
folder and run:
$ wp plugin update advanced-custom-fields
or
$ wp plugin update --all