Here’s how you can get the ID of the main site in a WordPress multisite network. This can be useful for switching to that blog using switch_to_blog( $blog_id ) to gain access to data from that site, then switching back with restore_current_blog() for example. Note: Although the $current_site global variable name in the code makes it look like […]

Read more