How I can Use $_SERVER['DOCUMENT_ROOT'] for wp multisite

1.2k views Asked by At

I have created a subdomain site using wp multisite function. Now if i want to access the Sub-Domain files and folders and all the posts to my main domain site can I do it by including $_SERVER['DOCUMENT_ROOT']?

If i can then How to do that If I can not then how to access those files to main domain?

Note all my subdomain site are rooted to public.html/ isnt that means my subdomain site is directected to root directory if so then how to access the subdomain files to main directory cause there is no subdirectory for my subdomain site inst that currect?

I am a bit confused

1

There are 1 answers

3
Md.Jewel Mia On

First, in your wp-config.php file, add this:

define( 'WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/folder/path/to/new/dir' );

And second, also in wp-config.php, add this:

define( 'WP_CONTENT_URL', 'http://yoursite.com/folder/path/to/new/dir');

You can read more about changing the wp-content dir on the Codex.