make croogo multisite

Making croogo multisite db and theme per domain consists of the following:

Am making the assumptions that db username is same for all sites, only the db will change. Also that the theme cannot be set from the admin panel, the theme with the name of the site will be used.

Changes:

.\app\config\bootstrap.php

$hostName = $_SERVER['HTTP_HOST'];
  $siteNames = array('site1.cselian.com' => 's1', 'site2.cselian.com' => 's2');
  $siteName = $siteNames[$hostName];
  define('SITE_DB', 'cselian_' . $siteName);
  define('SITE_THEME', $siteName);

.\app\config\database.php

  var $default = array(
    ...
    'database' => SITE_DB,

.\app_controller.php

  //find the line commented below and replace with the SITE_THEME one.
  //$this->theme = Configure::read('Site.theme');
  $this->theme = SITE_THEME;

Warning: count(): Parameter must be an array or an object that implements Countable in /home/cselian/public_html/blog/wp-includes/class-wp-comment-query.php on line 405

Leave a Comment