开发者

is_multisite(); Support for Wordpress 3.0

开发者 https://www.devze.com 2023-01-08 23:57 出处:网络
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 support

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

0

精彩评论

暂无评论...
验证码 换一张
取 消