title: Wordpress - Get root directory?
body: <p>How can I get the root directory of my site? I want to use it as the <code>src</code> for <code>&lt;img&gt;</code>.</p>
  
  <p>For example If I install the wordpress on <code>www.mysite.com/blog/</code>, the root is <code>/blog</code>.</p>
  
  <p>But If I install it to <code>www.mysite.com/test/blog</code>, the root is <code>/test/blog</code>.</p>
  
  <p>I tried to use the snippet from <a href="https://stackoverflow.com/questions/2354633/wordpress-root-directory">this question</a>, but it returns the whole path as seen in FTP. So instead of returning just <code>/blog</code>, it returns <code>/home/public_html/blog</code> which won't work if used as <code>src</code> in image tag.</p>
  
  <p>Any solution? Thanks.</p>