WordPress.org

Ready to get started?Download WordPress

Forums

Subdomain with Same Database Content? (7 posts)

  1. ericksonstudio
    Member
    Posted 6 years ago #

    I've searched high-and-low and haven't found a solution for this, so I throw this to the WP community...

    I have a client who wants a separate subdomain for an "iPhone-only" site, so iphone.domain.com. We have a beautifully working WP site already. The subdomain should pull from the same database as the main "www" site. The http://www.domain.com WP files are in a /www directory, but the iphone files are in the /subdomains/iphone/www directory.

    I want to pull the last 5 general posts, plus n number of posts from a specific category, but the real question is can I use the same content across subdomains on the same site and how?

    Yes, I know it would be easier to create an iPhone Theme and use a automagic theme-switcher, but this is what the client wants.

    Thanks in advance!

  2. ericksonstudio
    Member
    Posted 6 years ago #

    Anyone? Help?

  3. lcornwell
    Member
    Posted 6 years ago #

    I believe the only way to do this would be to have an installation of wordpress in a subfolder of the root. that way it can address the files of the original. If it is in a seperate folder there is not a way to map it correctly.

    I have a limited knowledge of this stuff...so I may be incorrect.

    Why not do http://www.domain.com/iphone??

  4. ericksonstudio
    Member
    Posted 6 years ago #

    Why not do http://www.domain.com/iphone??

    The simple answer is the client doesn't want it.

    Thanks for the idea. I think I tried that already, but I'll give it another shot.

    Anyone else have some experience with this?

  5. Charles Frees-Melvin
    Member
    Posted 6 years ago #

    Okay this is not going to be easy but is possiable.

    The page mist be a php page, if you place
    <?php require('../wp-blog-header.php'); ?>
    at the top of the page and point it to the wp-install you can then place the wp code for "The Loop" in the page.

    It will output the same CSS tags as the wordpress install. Hope this leads you in the right direction. I use it to use the wp-theme on non wordpress pages.

  6. ericksonstudio
    Member
    Posted 6 years ago #

    Well, that didn't work (using the wp-blog-header.php file). It looks like the server won't let me include anything from the /www directory -- not even a plain txt file.

    Maybe a permissions issue?

  7. boilr
    Member
    Posted 5 years ago #

    i am interested in the same end result as ericksonstudio has requested help on. i have a feeling a lot of ipod touch/iphone owners who also own their own domain and use wordpress to blog would also like to make this happen. currently, the only other solution is to run a separate iphone-formatted theme via a plugin, BUT this does NOT work if you use wp-cache or the like.

    is it possible, albeit cumbersome, to do a second wp install in the subdomain and "republish" or syndicate (rss) the latest 20 or so posts in the second install of the i-site?

    either way, if anyone can help us solve this very desirable result, it would be greatly appreciated!

    http://www.boilr.net

Topic Closed

This topic has been closed to new replies.

About this Topic