WordPress:WPMU Functions/get current site
来自站长百科
This page is [[WordPress::Category:Stubs|marked]] as incomplete. You can help Codex by expanding it.
Returns the following items:
id domain path site_name
Usage
To get the blog id, you would use the following code:
$current_site = get_current_site(); echo $current_site->id;
Or, to do the same, but in only one line:
echo get_current_site()->id;
Other
The function as found in footer.php of most Wordpress themes:
<?php $current_site = get_current_site(); ?>
Need content to help solve the following PHP fatal error:
Fatal error: Call to undefined function get_current_site() in /blah/www.mysite.com/wp-content/themes/blah/footer.php on line 2