Deploying WordPress with Composer

You can do whatever suits your needs, such as still using composer but configuring your implementation to place the directories back into the root along with core, however the primary purpose in having core stand-alone from other directories is for separation of concerns that are not dependant upon one another sharing the same path. The … Read more

Use composer to load custom classes [closed]

Without more context from you, I can only assume and show you what I have done that works for me using PSR4 Autoloading. Example: Assuming that all my custom class directories and files is in ./inc folder In your composer.json, add this “autoload”: { “psr-4”: { “Inc\\”: “./inc” } } Inc is the vendor name … Read more

WordPress with composer, how to handle updates?

Basically in “common” WordPress setup you have two things inside the folder that aren’t part of the core itself: content folder and wp-config.php configuration file. So you are on completely right path: You configure content folder to be elsewhere, outside of core folder You place wp-config.php one directory level above the core folder (WP will … Read more

Autoloading in Child Theme

So there are one or two things to keep in mind: There should only be 1 vendor folder There should be a primary composer.json that’s in your project root, that would pull in all the dependencies You always check for and load the autoloader in the current directory, there’s no guarantee it is or isn’t … Read more