Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Get the Blog ID of the Main Site in a WordPress Multisite Network
<?php
/*
* Get the Blog ID of the main site in a multisite network.
*
* @return int The blog_id of the main site.
*/
function km_get_main_site_blog_id() {
return get_network()->site_id;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.