WordPress.org

Ready to get started?Download WordPress

Forums

using alternative wpdb (connecting a page template to external db) (2 posts)

  1. maxemil
    Member
    Posted 3 years ago #

    Goal:
    Having a single page in my WordPress, load data from an external WP installation.

    I have tried installing an extra WP instance in a subdirectory with the wp-config being the same as the external site (DB_NAME/DB_USER/DB_PASSWORD/DB_HOST) and then
    define('WP_HOME', 'http://localhost/wp1/external');
    define('WP_SITEURL', 'http://localhost/wp1/external');
    wp1 being the local install with its own database, and external using its own wp-config.php

    This works SOMEWHAT ok..
    However, many things are configured inside wp-options table that dosent really workout for me.. appaently when I update WP settings for the WP1 or on the external, it also happens at the same time on the local. Whatever plugins are installed on WP1, MUST also be installed on external, or they are automatically disabled on WP1 ..?
    Whenever I change something on the local, its updating the wp-options table on the remote and makes life hard.

    What I really "just" want is a page in my site, that uses an external WP installations database. (making raw mysql commands isent enough, as i need commenting and propably other functions available.)

    Is there a way to override the WPDB, inserting another DB than the wp-config enabled for PAGE templates?

    Or is there another solution im overlooking?

    BR\Emil

  2. maxemil
    Member
    Posted 3 years ago #

    A quick follow up to myself,
    I cant in my head consume the way I would have to weave together the databases, so I'm using a full install of WP in a subdirectory and a remote database..

    The only real not so cool thing is the detection of which WP install does the presentation. (when people signup for news and comment notification on the different databases & synchronizing certain users..)

    Why all this, well I have a internal website inside a firewalled network, and a external website to communicate comments realtime.. anyways.. :)

Topic Closed

This topic has been closed to new replies.

About this Topic