Looki开发者_开发百科ng for a variable to use to differentiate between sites in a Wordpress 3.0 Multisite installation. I saw the function "is_multisite();" in some blogs, but not sure if its supported yet. I have one theme I'd like to use on all the Network's sites, but need a way to use conditions between them.
Thanks for the help.
This article dicusses a few different techniques for determining if the site is in a Multisite installation. Below is a cleaned up version of their custom function:
function yourtheme_is_multsite() {
global $wpmu_version;
if (function_exists('is_multisite'))
return is_multisite();
return !empty($wpmu_version));
}
$current_blog->blog_id
or ->path
might be what you're looking for? They differentiate sites within the same network (albeit not in a very helpful way).
http://codex.wordpress.org/WPMU_Global_Variables
精彩评论