admin管理员组

文章数量:1291718

I want to move wp-content folder out of wordpress installation folder. I have set

define('WP_CONTENT_DIR', '/opt/deployer/wordpress/wp-content' ); in wp-config.php file. But themes stopped working on site.

Please help me.

I want to move wp-content folder out of wordpress installation folder. I have set

define('WP_CONTENT_DIR', '/opt/deployer/wordpress/wp-content' ); in wp-config.php file. But themes stopped working on site.

Please help me.

Share Improve this question asked Oct 28, 2015 at 15:58 abhi shuklaabhi shukla 1011 bronze badge 1
  • Where in wp-config.php did you add your define() line? It needs to go before the /* That's all, stop editing! Happy bloggin.! */ line. See wordpress.stackexchange/questions/103945/… . – Pat J Commented Oct 28, 2015 at 16:17
Add a comment  | 

2 Answers 2

Reset to default 2

The answer depends on why are you moving the folder.

If you just need to folder to be moved but leave the URLs the same then you will need to adjust yout apache/nginx config files to point to the right directory when serving a request for a url of the type /wp-content/...

If you need to adjust the url as well then you need to also define appropriate WP_CONTENT_URL

Create a folder as blog.

put wp-contant folder in blog folder.

define this line in config.php

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

define( 'WP_CONTENT_DIR', dirname(FILE) . '/blog/wp-content' );

本文标签: customizationMoving wpcontent folder