• Resolved pvandervossen

    (@pvandervossen)


    I’ve done extensive searching, and I’ve seen people with similar threads, but everywhere I see someone asking the exact same question as myself, I don’t see a response, so I figured I would try again.

    I have an existing site. I want to split out some subsites that utilize the same content, users, etc. The purpose of the subsites is to display just one category of content. Essentially I am segregating content types for better user and advertiser targeting. The master site will still exist, and pulls all categories together.

    Here is the kicker though, each of these subdomains will use the essentially the same theme, but with different options. The different options are because the theme needs to display different categories of content. (Magazine style theme)

    So I know I need subdomains, which I have setup. Each subdomain essentially contains the same information, theme files (which will be modified once I get this working) etc. The wp_config files all point back to the same database, because I want to share content. And that all works, I essentially have cloned my site to the subdomain. However the issue is I need a customize the options for each site, so I need to utilize different options tables for each site.

    I don’t see anyplace where this is possible. I found the table array in wp-db.php, and modified the name of the options table there (var $tables = array), but when I do that, the site fails to install.

    I’ve gone round and round with several plugins, and various ways of installing, but I can’t find anywhere which allows me to use a different options table. I’m by no means an expert, but I’m competent problem solver when it comes to working an issue like this. However I have apparently exhausted my capabilities at this point. Anyone have any experience, thoughts? Any help is greatly appreciated

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter pvandervossen

    (@pvandervossen)

    Nevermind, I think I found it thanks top this site :
    https://www.wiseontech.com/hack/wordpress-hacking-multiple-blogs-on-one-set-of-tables-2

    Down in the comments they refer to more modern installs. I did this:

    Edit the wp-db.php file in the wp-includes directory.
    In the function set_prefix($prefix) section

    After :

    foreach ( $this->tables as $table )
    $this->$table = $this->prefix . $table;

    Added :
    $this->options = ‘wp_’ . ‘options’;

    Or whatever your new prefix is. Testing now, I’ll write again if I experience any issues. This is a case of spending 4 hours a few nights ago, and going around in circles. Then after only 20 minutes of trying tonight, getting it working. The benefits of rest apparently.

    How about images in the upload folder!! How will the one site refers to another for the graphics in the post.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Multiple Sites, Same Database, Different Options Table’ is closed to new replies.