How can I retrieve the path to the root directory in WordPress CMS?
You can use get_site_url() function to get the base url of the wordpress site.
For more information, please visit http://codex.wordpress.org/Function_Reference/get_site_url