我和你一起去this git workflow 对于我当前正在本地运行的wordpress项目MAMP
. 它允许我使用子模块将WP核心文件从主题和插件文件夹中分离出来,这很好。我的wp-config
有一些额外的条目可以告诉Wordpress核心文件和主题文件夹的位置:
if ( !defined(\'ABSPATH\') )
define(\'ABSPATH\', dirname(__FILE__) . \'/wordpress/\');
define(\'WP_HOME\', \'http://\' . $_SERVER[\'HTTP_HOST\'] . \'/core\');
define(\'WP_SITEURL\', \'http://\' . $_SERVER[\'HTTP_HOST\'] . \'/core/wordpress\');
define(\'WP_CONTENT_DIR\', realpath(ABSPATH . \'../wp-content/\'));
define(\'WP_CONTENT_URL\', WP_HOME . \'/wp-content\');
define(\'UPLOADS\', \'../wp-content/uploads\');
我的网站根目录结构如下所示:-wordpress (contains core files)
-wp-content
-themes
-plugins
-uploads
-wp-config.php
因此,我的主页url是:http://localhost:8888/core/
我遇到的所有问题都与插件有关。其中一些正在使用get_bloginfo(\'wpurl\')
加载资源。下面是一个例子:
http://localhost:8888/core/wordpress/wp-content/plugins/{PLUGIN}/images/{PLUGIN_IMAGE}.png
实际位置:http://localhost:8888/core/wp-content/plugins/{PLUGIN}/images/{PLUGIN_IMAGE}.png
我可以在不单独修改插件的情况下重写它吗?