Starting a new project
mango init --source manGoweb/MangoPress your-project-name cd your-project-name composer install
- Create a new database for WordPress installation
- Create your
- Make directories
public/wp-content/*writeable for web process
app- Nette MVC application
config- All configuration in one place
public- Public directory to be set as document_root dir
assets- compiled theme assets, do not edit them here
wp-content- WP content directory
wp-core- WP distribution installed via composer
theme- main WP theme with all templates and original assets
vendor- 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:
index.phpand other WP template files as controllers (php code only). Controller should define and fill a context for an actual template.
- Use templates
views/*.latteas views. All the HTML chunks belong here. Work with given context only and do not execute unnecessary php code.
- Assets source directories are
imagesand the mango-cli compiles them to the
Mangopress has wordpress-s3-media plugin installed by default. It uploads to and serves all media from aws s3.
For local development, you should have
parameters.s3.enabled set to
false and use filesystem as usual.
Don't forget to set
parameters.s3.secret in production config.
Manage WP plugins
composer install wpackagist-plugin/PLUGINNAME
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.
Applications deployed to production servers cannot install, update, or remove plugins at all. All changes must be tested, versioned and properly deployed instead.
Nette generates links that lead to the 404 page
Go to the Wordpress admin panel, then click Settings and go to the permailnks secion. From there just submit the form. That might resolve the issue.