Plugins and themes are located outside the wp folder, so we can manage them separately: on one hand themes and plugins and on the other wordpress itself.
Structure
-
public/
- wp-content/ - It contains plugins and themes
- wp/ - Our subdirectory install location for WordPress
- .htaccess - If necessary
- index.php
- wp-config.php
-
vendor/
-
.gitignore
-
composer.json
-
composer.lock
-
local-config.php
-
.gitignore
- Create a folder: mkdir my_folder
* Be sure you have Composer installed. If you don't have it globaly installed, you can donwload the composer.phar localy (curl -sS https://getcomposer.org/installer | php
)
- Create folder my_folder/public/
- Create composer.json. Copy the file uploaded in txinparta/wordpresspj
- Create .gitignore
- Install WordPress: run composer install (or
php composer.phar install
)
- Copy and move
cp -R public/wp/{wp-content,index.php,wp-config-sample.php} public/
mv public/wp-config-sample.php public/wp-config.php
- Modify public/index.php:
require( dirname( __FILE__ ) . '/wp-blog-header.php' );
Replace by:
require( dirname( __FILE__ ) . '/wp/wp-blog-header.php' );
- Configure local-config.php.
Fill out database data connection and keys (https://api.wordpress.org/secret-key/1.1/salt/).
- Configure public/wp-config.php.
In the same way as it is in this repository.