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. View the code on Gist.   Alternate function for WordPress versions < 4.6.0 For […]

Read more