One base – a lot of blogs – Eine Base für mehrere Blogs

Surely you have met (I mean users and fans of WordPress) with a situation where you want to install on a WordPress blog several different subjects, and how do they know not?
Recently, I accidentally „bumped“ into one of the acceptable options for the realization of this desire. In fact, it turned out, everything is easy!
little hack that will allow you to use a single database and code base for conducting WordPress several of your blogs.
wordpress-tipps

$domain_list = array();
$domain_list["site1.com"] = "wp1_";
$domain_list["site2.com"] = "wp2_";
// TODO:
// Add entries for each blog
$domain_name = preg_replace("/^www\./", "", $_SERVER["SERVER_NAME"]);
if (array_key_exists($domain_name, $domain_list)){
$table_prefix = $domain_list[$domain_name];
if (!$table_prefix) { $table_prefix = "wp_" . md5($domain_name); }
}else{print "ERROR! No Fund!"; exit;}

Blog Startseite
Besuch uns auf Youtube

Über den Autor

Olena Seregina

Was ich soll und schulde, steht im Steuerbescheid.
Was ich nicht darf, steht im Strafgesetzbuch.
Und alles andere kann ich selbst entscheiden.
/ viktor37/

Copyright © 2010 - 2020 You-Big-Blog.com