I prefer installingWordPress into ../app/public/wordpress, but leaving content at ../app/public/wp-content.
I think that’s a best practice, because it separates third-party files from custom code. It makes it easier to treat WordPress as a dependency, and keep the root folder much more organized.
It’s possible to do that manually*, but I think the site.conf.hbs changes will get overwritten the next time Local changes it. It’d be nice to WP in a subdirectory instead by default, or at least have an option to do it. Alternatively, you could load site.conf.hbs.local if it exists, and otherwise use the default config.
- For anyone looking to manually configure things this way, you’ll need to make these changes:
- Move
wp-admin,wp-includes, and the root files into aapp/public/wordpress. Leavewp-contentandwp-config.phpatapp/public. - Create a new
index.phpthat just has:require_once __DIR__ . '/wordpress/index.php'; - In
wp-config.php, add these lines:
define( ‘WP_CONTENT_DIR’,
__DIR__. ‘/wp-content’ );
define( ‘WP_CONTENT_URL’, ‘https://core.test/wp-content’ );
- In
conf/nginx/site.conf.hbs, remove therootdirective, and add these lines in theserverblock:
root {absolute path to your site}/app/public/wordpress;
location ~* (/wp-content) {
root /Users/iandunn/local-sites/core/app/public;
}
Optionally, you can also create a {local directory]/{your site}/wp-cli.yml that has:
path: app/public/wordpress