This project template should provide a kickstart for managing your site dependencies with Composer.
This project consist of:
- WordPress core: johnpbloch/wordpress-core-installer
- Repository https://wpackagist.org/ to install WordPress plugins and themes
composer/installers
to set custom paths for plugins and themesdrupal-composer/preserve-paths
to exclude paths for plugins and themes under version controlwodby.yml
that runscomposer install
. You can remove it if you're not using Wodby
By default, wordpress core will be installed in ./web
directory. Plugins and themes are installed in ./web/wp-content/plugins
and ./web/wp-content/themes
.
- First you need to install composer
- Fork and clone this repository
- Run composer install in your repository root
Update require
section in composer.json
as described on https://wpackagist.org/
- Exclude path to your plugin or theme from .gitignore. Example for theme under
web/wp-content/themes/my-custom-theme/
:!web/ web/* !web/wp-content/ web/wp-content/* !web/wp-content/themes/ web/wp-content/themes/* !web/wp-content/themes/my-custom-theme/
- Add the same path to your composer.json under
extra > preserve-paths
:"preserve-paths": [ "web/wp-content/themes/custom" ]
- Add your plugin/theme directory under version control
- Run
composer install
. Composer will install WordPress core and keep your custom theme