hgnm-wp-dev
Scripts to help you get set up with a local WordPress install and work on the
hgnm-2014
theme, using Local by Flywheel.
Set-up
The scripts included here will install & activate required WordPress plugins, populate WordPress with real content from hgnm.org, and install & activate the hgnm-2014
WordPress theme as a development repository.
1. Install & set-up Local
We are going to use Local, a free desktop app that allows you to run local WordPress instances.
-
Once the download has finished, run the installer and open Local
-
Create a new site using the dialog displayed or File > Add New Site (⌘ N)
The settings are not very important, but for the rest of this guide we will assume you enter
hgnm
as the site name -
Click through as Local sets up your site, making a note of the username and password you enter in the “Setup WordPress” panel
2. Configure the site for HGNM development
-
Open a Terminal window and move to the site directory:
cd ~/Local\ Sites/hgnm
-
Clone this repository:
git clone https://github.com/HGNM/hgnm-wp-dev.git
-
Run the first bootstrapping script:
./hgnm-wp-dev/one
-
Return to the Local app, right-click on your site and select Open Site SSH
-
A new Terminal window will open. This process is running inside Local’s virtual machine. Run the second bootstrapping script:
./app/two
You can now close the new Terminal window.
3. Enjoy!
At this point a default WP install is available at http://hgnm.local/ (unless you chose a different local address in step 1).
Head over to the hgnm-2014
repository for notes on how to develop the theme.
You can move to the theme directory using the following command:
cd ~/Local\ Sites/hgnm/app/public/wp-content/themes/hgnm-2014
Usage
Once you have followed the steps above, closing Local will close the local server and opening Local will start it again.
Useful notes
-
If you would like to use WP-CLI to accomplish some tasks, it is available as
wp
on the virtual machine, which can be opened using Open Site SSH as in step 2.4 above. -
If you want to display PHP debugging messages, you can add the following to
wp-config.php
(found in~/Local Sites/hgnm/app/public/
):/** Enable/disable PHP debugging */ define( 'WP_DEBUG', true );