network_home_url()
Gets the URL of the homepage of the main site in the current network of sites (for MU installation).
The URL is returned with auto-detection of the protocol: https or http. You can specify the protocol explicitly by setting it in the $scheme parameter.
network_home_url() — an analog of home_url() but for the network...
This function actually returns the same as network_site_url() and is a copy of it. For the network, unlike a single site or a site in the network, there is no difference in the URL even when the WP core is installed in a subdirectory...
Hooks from the function
Returns
String. URL to the homepage.
Usage
echo network_home_url( $path, $scheme );
- $path(string)
- Path to be added to the URL.
Default: '' - $scheme(string)
- URL protocol. Can be:
http,https,relative.
Default: null (auto-detected see is_ssl())
Examples
#1 Get the link to the main blog of the network of sites
echo network_home_url(); // outputs: http://www.example.com
Changelog
| Since 3.0.0 | Introduced. |