How to query WP Multisite primary site link

Use network_home_url( $path=””, $scheme = null ). You can see it in /wp-includes/link-template.php. Examples: // Root of main site $network_home = network_home_url(); // About page on main site $network_about = network_home_url( ‘about/’ ); In a network, the main site has always the same ID as the network ID. network_home_url() uses get_current_site() which return the global … Read more

Display site administrator’s id by current blog id inside link

If you want to construct for example: http://example.com/?ref=1,8,22 for multiple administrators of the current sub site, you can try the following (untested): $uids = get_users( array( ‘blog_id’ => get_current_blog_id(), ‘role’ => ‘administrator’, ‘fields’ => ‘ID’, ‘order_by’ => ‘ID’, ‘order’ => ‘ASC’, ) ); echo $url = add_query_arg( array( ‘ref’ => join( ‘,’, $uids ) ), … Read more

Create custom role, multisite, add users/sites?

According to the Codes on capabilities the manage_sites and manage_network_users should grant these options, or am I not reading correctly? Apparently, the capabilities here are not enough. Check out wp-admin/network.php. You’ll see it dies if the current user fails the is_super_admin check. This check gets the $super_admins global from get_super_admins and returns false if the … Read more

MultiSite Move conjures duplicate URL

I would suggest to use Search and Replace utility when you move your WordPress Network. it seamlessly update all the fields of the database from old domain to new domain. After that, you only need to update the domain name in wp-config.php. (Tip: do not include http:// and trailing slash while replacing the domain rather … Read more

The requested URL /login was not found on this server

wp-login was not found error clearly means that you have lost control on WordPress admin panel. Even if this situation looks terrible but in real, it’s not. Situation A: The URL might be wrong In most cases, the WordPress installed in its own directory. When a user tries to change the default URL path of … Read more