WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to find Site Root? (2 posts)

  1. tmb_ayebe
    Member
    Posted 7 years ago #

    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.

  2. yosemite
    Member
    Posted 7 years ago #

    Might want to take a look at bloginfo() here: http://codex.wordpress.org/Template_Tags/bloginfo

Topic Closed

This topic has been closed to new replies.

About this Topic