amitrahav/wordpress-starter

WordPress boilerplate with modern development tools, local development docker-compose support, env configuration, wp-engine ready for push, and an improved folder structure

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 0

Forks: 0

Language:Shell

Type:project

dev-master 2020-03-16 12:59 UTC

This package is auto-updated.

Last update: 2020-07-16 13:40:06 UTC


README

Dependencies

  1. Appache proxy on localhost or Docker
  2. Composer

Credits

Existing Project

  1. Navigate to project root directory:

    cd /path/to/your/project/folder/
  2. Clone zipped specific repo files:

    $ curl https://codeload.github.com/amitrahav/wordpress-starter/tar.gz/master | tar -xz --strip 1
  3. Install all requirements from composer

    • By default, ACF PRO is a must use plugin. in order for it to be installed you should add a key to .env file.
     mv .env.example .env
     composer install && composer update
  4. Ignore all ops files by adding

    $ echo '\n/data/\n/data/logs\n!/data/.gitkeep\n!/data/logs/.gitkeep\nenvironments\nscripts\n*.example\n*.lock\nlogs.ini\nrobots.txt\n# HERE GOES YOUR APP EXCEPTION' >> .gitignore

Database setup

  • save your db sql dump at data folder (this is enough for Docker)

  • Local Proxy:

Development

Switch to latest branch

  • master - stable production copy,
  • develop - current development copy
git checkout <branch-name>

Create new branch for your changes

git checkout -b <issue#>_<short descr></short>

Create your environment

  1. Update environment variables in .env file:
  • DB_NAME - Database name
  • DB_USER - Database user
  • DB_PASSWORD - Database password
  • DB_HOST - Database host
  • WP_ENV - Set to environment (development, staging, production)
  • WP_HOME - Full URL to WordPress home (http://example.com)
  • ACF_PRO_KEY - Acf key for installing the full version of acf plugin

Setup VScode tasks

If you want you can use the .vscode/tasks.json file for auto processes using vscode tasks. you need to install globally node-sass npm i -g node-sass and change path to your project (theme or plugin) sass and css files on the tasks file.

Require Wp plugins and themes

  1. use composer.json or composer cli
  2. if using docker, add themes or plugins to script/init.sh file to activate on wp cli when docker is up

Add Acf as a Must-Use Plugins

run this after you run $composer install && composer update

    $ echo "<?php require_once(__DIR__ . '/advanced-custom-fields-pro/acf.php');" > wp-content/mu-plugins/advanced-custom-fields-pro.php