Fine tuned WordPress structure with the horse power of the Nette Framework, all utilizing the Composer and mango-cli.
mango init --source manGoweb/MangoPress your-project-name
cd your-project-name
composer install
Requirements: PHP stack, Composer, mango-cli
Additional steps:
- Create a new database for WordPress installation
- Create your
config/config.local.neon
based onconfig.local.sample.neon
. - Make directories
log/
,temp/
,public/wp-content/*
writeable for web process
app
- Nette MVC applicationconfig
- All configuration in one placepublic
- Public directory to be set as document_root dirassets
- compiled theme assets, do not edit them herewp-content
- WP content directorywp-core
- WP distribution installed via composer
theme
- main WP theme with all templates and original assetsvendor
- composer packages
You are going to spent the most of your time in the theme
directory. Follow these code architecture instructions to avoid a loss of your sanity:
- Use
index.php
and other WP template files as controllers (php code only). Controller should define and fill a context for an actual template. - Use templates
views/*.latte
as views. All the HTML chunks belong here. Work with given context only and do not execute unnecessary php code. - Assets source directories are
styles
,scripts
andimages
and the mango-cli compiles them to thepublic/assets
distribution directory.
composer install wpackagist-plugin/PLUGINNAME
Thanks to wpackagist repository, you can install all plugins and themes from official WordPress directory via composer.
Installed plugins are used as mu-plugins, which cannot be disabled or removed from administration. Beware: not all plugins can work that way, especially ones that need some sort of activation initialization steps.
Copyright 2014 by manGoweb s.r.o. Code released under the MIT license.