Answer the question
In order to leave comments, you need to log in
Wordpress & Composer: Installing Carbon Fields correctly?
Almost figured out the new development trend on WP. I set up my build with Composer and everything makes me happy, except for the Carbon Fields plugin. After reading the documentation for off. site on this plugin I was delighted with it!
The only problem in the installation, namely:
I have a project structure similar to Bedrock , and when installing Carbon FIelds 2.2.0 in standard mode in the vendor folder, which is in the root, there is a problem with assets (css, js), since they are one level above the site.
The docs have a page called Support for Bedrock & similar frameworks, but I'm a little confused, if I specify the installation path to the web folder (as in Bedrock), then another vendor folder with Carbon Fields will appear in the web pack, but this will not work anyway, you can see why here .
That is, assets work fine if the plugin works if it is in the content folder, or in the plugins folder, or in the WordPress folder. But still, you can make it work from any other directory, just not higher than the site level (in the case of Bedrock, this is the web folder) by defining a constant:
define('Carbon_Fields\URL', home_url() . '/vendor/htmlburger/carbon-fields');
Answer the question
In order to leave comments, you need to log in
Set up your build with Composer
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question