WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/is main site

Description

Test if site is main site, given site id

Usage

<?php is_main_site$blog_id ?>

Parameters

$blog_id
(integer) (optional) optional site id to test (default to current site) .
Default: defaults to empty

Return Values

(boolean) 
True if not multisite or site is main site

Examples

<?php
if ( is_main_site($blog_id) ) {
  // display something special for the main site.
}
?>

Notes

Replaces function is_main_blog(), deprecated since 3.0.0. (wp-includes/ms-deprecated.php)

Change Log

Since 3.0.0.

Source File

is_main_site() is located in wp-includes/functions.php.

Related

See also index of Function Reference and index of Template Tags.