Changing WP_CONTENT_DIR and WP_CONTENT_URL in wp-config.php does not register?

I tried to add this to the end of my wp-config.phpdefine('WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT']

I tried to add this to the end of my wp-config.php

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

however, echo immediately after that shows the old values (with wp-content value). I tried echo because in wp admin I couldn't see the theme from new location, of course.

I have installed wp in example/wp subdirectory and site itself is example - I copied over .htaccess and index.php over to the root and everything is working fine, I just need to move wp-content into another folder over at root also with a different name.

I tried to add this to the end of my wp-config.php

define('WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/somedir');
define('WP_CONTENT_URL', 'http://example/somedir');

however, echo immediately after that shows the old values (with wp-content value). I tried echo because in wp admin I couldn't see the theme from new location, of course.

I have installed wp in example/wp subdirectory and site itself is example - I copied over .htaccess and index.php over to the root and everything is working fine, I just need to move wp-content into another folder over at root also with a different name.

Share Improve this question asked Jun 23, 2013 at 16:54 KeyframeKeyframe 1431 gold badge1 silver badge4 bronze badges 1
  • slash / before somedir is superfificous (double) in line 1. – Frank N Commented Sep 5, 2015 at 15:58
Add a comment  | 

1 Answer 1

Reset to default 15

You have probably added the definitions too late. If in fact you added that "to the end" of wp-config.php then you added it after these lines:

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');

If so, then those constants are already defined (wp_initial_constants) and you cannot redefine a constant after it is already defined.

Make your edits earlier, before:

/* That's all, stop editing! Happy blogging. */

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745569005a4633566.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信