关于wordpress:更改wp-content和plugins目录

change the wp-content and plugins directory

嗨,我正在尝试对wordpress进行自定义安装,我需要更改wp-content和plugin-directories。

我在安装wordpress后尝试将其添加到wp-config.php

define('WP_CONTENT_DIR',dirname(FILE)。'wp-content');
define('WP_CONTENT_URL','myurl / wp-content');

但我仍然看到我对WP_PLUGIN_DIR和WP_PLUGIN_URL做的默认插件。

谁能帮我。 提前致谢。


将此用于插件文件夹

1
define( 'WP_PLUGIN_DIR', $_SERVER['DOCUMENT_ROOT'] . '/somedir' );

将此用于WP-content文件夹

1
define( 'WP_CONTENT_DIR',  $_SERVER['DOCUMENT_ROOT'] . '/somedir' );

使用此代码...

1
2
3
define( 'WP_CONTENT_DIR', dirname(__FILE__) . 'path/to/wp-content' );

define( 'WP_CONTENT_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/path/to/wp-content' );