[Resolved] How to find Site Root?
I am writing a plugin, and I need to make urls to files that the plugin has uploaded.
Is there a constant or a function that can tell me the root of the wordpress website?
I don’t want to use “/” because it assumes that WordPress is installed on the root of the domain, which is not always the case. For example, on my test box WordPress is installed at “/wordpress/”.
Thanks in advance for your help.
Ok, forget it, I answered my own question. For anyone else wondering this just do
$siteurl = get_option("siteurl");
That will give you an absolute path the wordpress site’s root.
- The topic ‘[Resolved] How to find Site Root?’ is closed to new replies.