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
Requires
- php: >=7.1
- advanced-custom-fields/advanced-custom-fields-pro: *
- composer/installers: *
- johnpbloch/wordpress: ^5.6
- justcoded/wordpress-composer-scripts: ~1.2
- vlucas/phpdotenv: ^3.3.2
- wpackagist-plugin/contact-form-7: *
- wpackagist-plugin/wordpress-seo: *
Requires (Dev)
- justcoded/phpcodesniffer: dev-master
- wpackagist-plugin/fakerpress: ~0.4.10
- wpackagist-plugin/wordpress-importer: *
This package is auto-updated.
Last update: 2025-03-13 03:56:30 UTC
README
Quick start
curl -L https://api.github.com/repos/amitrahav/wordpress-starter/tarball | tar xzf - --strip 1
Dependencies
- Appache proxy on localhost or Docker
- Composer
Credits
- this template based on justCpded / WordPress Starter for composer support
- this template also use visiblevc/wordpress-starter for docker support.
- .gitignore ready for wp-engine git push without core wp.
Auto install
You can auto install all the basic goodies by running ./autoinstall
.
Its includes:
- New Theme - with scripts and desired plugins.
- Existing theme - that you can pull form git repo and continue working on it within this framework inside the docker with composer.
- (Future feature) Plugin - initialize plugin
Existing Project
-
Navigate to project root directory:
cd /path/to/your/project/folder/
-
Clone zipped specific repo files:
$ curl https://codeload.github.com/amitrahav/wordpress-starter/tar.gz/master | tar -xz --strip 1
-
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
-
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:
-
wp-cli import mysql dump:
$wp db import mysql.sql
requires local wp-cli install -
with phpmyadmin
-
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
- Update environment variables in
.env
file:
DB_NAME
- Database nameDB_USER
- Database userDB_PASSWORD
- Database passwordDB_HOST
- Database hostWP_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
- use composer.json or composer cli
- 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