How can I retrieve the path to the root directory in WordPress CMS?
Looking at the bottom of your wp-config.php file in the wordpress root directory will let you find something like this:
if ( !defined('ABSPATH') ) define('ABSPATH', dirname(__FILE__) . '/');
For an example file have a look here: http://core.trac.wordpress.org/browser/trunk/wp-config-sample.php
You can make use of this constant called ABSPATH in other places of your wordpress scripts and in most cases it should point to your wordpress root directory.
1.4m articles
1.4m replys
5 comments
57.0k users