WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] How to find Site Root?

[Resolved] How to find Site Root?

  • Hi,

    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.

    EDIT:
    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.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] How to find Site Root?’ is closed to new replies.
Skip to toolbar