Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Someone using my plugin/theme surprised me by making their site address different than their install address with the "Enter the address here if you want your site homepage to be different from the directory you installed WordPress." option.

Example:

They've installed at:

www . thesite . com / blog /

And their actual wordpress site shows up at

www . thesite . com

Which function properly delivers the filepath (not URL) leading to www . thesite . com ? I have a unique case where this is needed.

Considering random cases, it would have to work if a user chooses www . thesite . com / random / location /


CLARIFICATION:

If the site as a whole was installed at www . thesite . com / blog virtually every URL and *file*path is relative to that location. BUT if they modify their settings so that the blog is shown at a different spot OTHER than the install director ( such as www . thesite .com OR www . thesite . com / somerandom / chosen / url ) what I need is the FILE PATH to that location.

REASON: I have a network of sites running, and the plugin installs certain network oriented files at their "home" location.

share|improve this question

3 Answers 3

I recommend reading up on the site_url() function. Take a look here: http://codex.wordpress.org/Function_Reference/site_url and specifically, read the difference between:

site_url() & home_url()

Then you could look at parse_url() or ABSPATH as suggested before by @NickJAB

share|improve this answer
    
I'm probably not explaining things properly. I'll update the question for clarity –  user1915665 Sep 4 '13 at 4:11

If I understand your question right, you are looking for the absolute path to Wordpress. ABSPATH is a constant defined in the wp-config.php file that you may be able to use for this purpose. You can see it by:

<?php echo ABSPATH; ?>
share|improve this answer

I think they actually moved their main wordpress index.php and .htaccess files from www.thesite.com/blog to www.thesite.com root.

And changing is been made to index.php

Edit on index.php file:

Before:

require('./wp-blog-header.php');

After:

require('./blog/wp-blog-header.php');

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.